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-12927. RU: Falcon server restart failed during tar, need to add retries to command (Swapan Shridhar via alejandro)
Date Wed, 18 Nov 2015 21:07:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 285111f36 -> 344ed7251


AMBARI-12927. 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/344ed725
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/344ed725
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/344ed725

Branch: refs/heads/trunk
Commit: 344ed725182c2094f00ce4153515467ddcb52cc0
Parents: 285111f
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Nov 18 13:05:43 2015 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Nov 18 13:06:19 2015 -0800

----------------------------------------------------------------------
 .../libraries/functions/tar_archive.py          | 13 +++++++++----
 .../stacks/2.1/FALCON/test_falcon_server.py     | 12 ++++++------
 .../python/stacks/2.2/KNOX/test_knox_gateway.py | 20 ++++++++++----------
 3 files changed, 25 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/344ed725/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/344ed725/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 422f181..96ee2db 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
@@ -216,13 +216,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', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set',
'falcon-server', u'2.2.1.0-2135'),
         sudo = True,
@@ -232,14 +232,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'],
@@ -546,14 +546,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/344ed725/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 df2a50f..193d707 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
@@ -255,13 +255,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', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set',
'knox-server', '2.2.1.0-3242'),
         sudo = True,
@@ -299,13 +299,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', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set',
'knox-server', version),
         sudo = True,
@@ -320,7 +320,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'],
@@ -371,13 +371,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', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set',
'knox-server', version),
         sudo = True,
@@ -392,7 +392,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'],
@@ -443,13 +443,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