ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-13927. RU: Falcon server restart failed during tar, need to add retries to command (Swapan Shridhar via alejandro)
Date Thu, 19 Nov 2015 01:22:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e10afc37f -> 9b4cd098b


AMBARI-13927. RU: Falcon server restart failed during tar, need to add retries to command
(Swapan Shridhar via alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9b4cd098
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9b4cd098
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9b4cd098

Branch: refs/heads/branch-2.1
Commit: 9b4cd098b9f6fbfb4c4c378c808483de0765c0e5
Parents: e10afc3
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Nov 18 17:21:06 2015 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Nov 18 17:22:26 2015 -0800

----------------------------------------------------------------------
 .../libraries/functions/tar_archive.py          | 13 +++++++++----
 .../stacks/2.0.6/OOZIE/test_oozie_server.py     | 16 ++++++++--------
 .../stacks/2.1/FALCON/test_falcon_server.py     | 12 ++++++------
 .../python/stacks/2.2/KNOX/test_knox_gateway.py | 20 ++++++++++----------
 4 files changed, 33 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b4cd098/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
index 49caf88..71dc4a4 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/tar_archive.py
@@ -23,9 +23,10 @@ from resource_management.core.resources.system import Execute
 def archive_dir(output_filename, input_dir):
   Execute(('tar', '-zcvf', output_filename, input_dir),
     sudo = True,
+    tries = 3,
+    try_sleep = 1,
   )
 
-
 def archive_directory_dereference(archive, directory):
   """
   Creates an archive of the specified directory. This will ensure that
@@ -34,15 +35,19 @@ def archive_directory_dereference(archive, directory):
   :param directory:   the directory to include
   :return:  None
   """
-  
+
   Execute(('tar', '-zcvhf', archive, directory),
     sudo = True,
+    tries = 3,
+    try_sleep = 1,
   )
-  
+
 def untar_archive(archive, directory):
   """
   :param directory:   can be a symlink and is followed
   """
   Execute(('tar','-xvf',archive,'-C',directory+"/"),
-          sudo = True,
+    sudo = True,
+    tries = 3,
+    try_sleep = 1,
   )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b4cd098/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index 0ce3cf6..9c2efe6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -1165,14 +1165,14 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Execute',
       ('tar', '-zcvhf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '/usr/hdp/current/oozie-server/conf/'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'oozie-server', u'2.2.1.0-2135'),
       sudo = True )
 
     self.assertResourceCalled('Execute',
       ('tar', '-xvf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '-C', '/usr/hdp/current/oozie-server/conf//'),
-        sudo = True)
+        sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Directory', '/tmp/oozie-upgrade-backup', action = ['delete'])
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode =
0777)
@@ -1233,13 +1233,13 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Execute',
       ('tar', '-zcvhf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '/usr/hdp/current/oozie-server/conf/'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'oozie-server', '2.3.0.0-1234'),
sudo = True)
 
     self.assertResourceCalled('Execute',
       ('tar', '-xvf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '-C', '/usr/hdp/current/oozie-server/conf//'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Directory', '/tmp/oozie-upgrade-backup', action = ['delete'])
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode =
0777)
@@ -1291,13 +1291,13 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Execute',
       ('tar', '-zcvhf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '/usr/hdp/current/oozie-server/conf/'),
-      sudo = True)
+      sudo = True,  tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'oozie-server', u'2.2.0.0-0000'),
sudo = True)
 
     self.assertResourceCalled('Execute',
       ('tar', '-xvf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '-C', '/usr/hdp/current/oozie-server/conf//'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Directory', '/tmp/oozie-upgrade-backup', action = ['delete'])
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext',mode =
0777)
@@ -1487,13 +1487,13 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Execute',
       ('tar', '-zcvhf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '/usr/hdp/current/oozie-server/conf/'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'oozie-server', '2.3.0.0-1234'),
sudo = True)
 
     self.assertResourceCalled('Execute',
       ('tar', '-xvf', '/tmp/oozie-upgrade-backup/oozie-conf-backup.tar', '-C', '/usr/hdp/current/oozie-server/conf//'),
-      sudo = True)
+      sudo = True, tries = 3, try_sleep = 1)
 
     self.assertResourceCalled('Directory', '/tmp/oozie-upgrade-backup', action = ['delete'])
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode =
0777)

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b4cd098/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 72c8b69..ea8c859 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -213,13 +213,13 @@ class TestFalconServer(RMFTestCase):
      '-zcvhf',
      '/tmp/falcon-upgrade-backup/falcon-conf-backup.tar',
      '/usr/hdp/current/falcon-server/conf'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-zcvhf',
      '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
      u'/hadoop/falcon'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'falcon-server', u'2.2.1.0-2135'),
         sudo = True,
@@ -229,14 +229,14 @@ class TestFalconServer(RMFTestCase):
      '/tmp/falcon-upgrade-backup/falcon-conf-backup.tar',
      '-C',
      '/usr/hdp/current/falcon-server/conf/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-xvf',
      '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
      '-C',
      u'/hadoop/falcon/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Directory', '/tmp/falcon-upgrade-backup',
         action = ['delete'],
@@ -540,14 +540,14 @@ class TestFalconServer(RMFTestCase):
      '/tmp/falcon-upgrade-backup/falcon-conf-backup.tar',
      '-C',
      '/usr/hdp/current/falcon-server/conf/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-xvf',
      '/tmp/falcon-upgrade-backup/falcon-local-backup.tar',
      '-C',
      u'/hadoop/falcon/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Directory', '/tmp/falcon-upgrade-backup',
         action = ['delete'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b4cd098/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py b/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
index 8b0b55b..082aa2c 100644
--- a/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
+++ b/ambari-server/src/test/python/stacks/2.2/KNOX/test_knox_gateway.py
@@ -250,13 +250,13 @@ class TestKnoxGateway(RMFTestCase):
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-data-backup.tar',
      '/var/lib/knox/data'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'knox-server', '2.2.1.0-3242'),
         sudo = True,
@@ -294,13 +294,13 @@ class TestKnoxGateway(RMFTestCase):
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-data-backup.tar',
      '/var/lib/knox/data'),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'knox-server', version),
         sudo = True,
@@ -315,7 +315,7 @@ class TestKnoxGateway(RMFTestCase):
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '-C',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/knox-server/conf/knox-conf-backup.tar',
         action = ['delete'],
@@ -366,13 +366,13 @@ class TestKnoxGateway(RMFTestCase):
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-data-backup.tar',
      '/var/lib/knox/data'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('hdp-select', 'set', 'knox-server', version),
         sudo = True,
@@ -387,7 +387,7 @@ class TestKnoxGateway(RMFTestCase):
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '-C',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True, tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/knox-server/conf/knox-conf-backup.tar',
         action = ['delete'],
@@ -438,13 +438,13 @@ class TestKnoxGateway(RMFTestCase):
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-conf-backup.tar',
      '/usr/hdp/current/knox-server/conf/'),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
     self.assertResourceCalled('Execute', ('tar',
      '-zcvhf',
      '/tmp/knox-upgrade-backup/knox-data-backup.tar',
      "/usr/hdp/%s/knox/data" % source_version),
-        sudo = True,
+        sudo = True,  tries = 3, try_sleep = 1,
     )
 
     '''


Mime
View raw message