ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [14/50] [abbrv] ambari git commit: AMBARI-18739. Perf: Create Rolling and Express Upgrade Packs. Another fix of concurrent cp (dlysnichenko)
Date Wed, 25 Jan 2017 18:57:03 GMT
AMBARI-18739. Perf: Create Rolling and Express Upgrade Packs. Another fix of concurrent cp
(dlysnichenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9bb27b42b85643b4fae89e54801171abbc3ec2ad
Parents: 203e9fa
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Mon Jan 23 18:00:45 2017 +0200
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Mon Jan 23 18:00:45 2017 +0200

----------------------------------------------------------------------
 .../PERF/1.0/hooks/before-INSTALL/scripts/hook.py    | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9bb27b42/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
index 0865ef5..f030cfc 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
@@ -17,6 +17,8 @@ limitations under the License.
 
 """
 import os
+
+from resource_management import ExecutionFailed
 from resource_management.core.resources.system import Directory, File, Execute
 from resource_management.libraries.script import Hook
 
@@ -37,12 +39,17 @@ class BeforeInstallHook(Hook):
     cache_dir = self.extrakt_var_from_pythonpath(AMBARI_AGENT_CACHE_DIR)
     conf_select = os.path.join(cache_dir, CONF_SELECT_PY)
     dist_select = os.path.join(cache_dir, DISTRO_SELECT_PY)
-    if not os.path.exists(CONF_SELECT_DEST):
-      Execute("cp -f %s %s" % (conf_select, CONF_SELECT_DEST), user="root")
+    try:
+      Execute("cp -n %s %s" % (conf_select, CONF_SELECT_DEST), user="root")
       Execute("chmod a+x %s" % (CONF_SELECT_DEST), user="root")
-    if not os.path.exists(DISTRO_SELECT_DEST):
-      Execute("cp -f %s %s" % (dist_select, DISTRO_SELECT_DEST), user="root")
+    except ExecutionFailed:
+      pass   # Due to concurrent execution, may produce error
+
+    try:
+      Execute("cp -n %s %s" % (dist_select, DISTRO_SELECT_DEST), user="root")
       Execute("chmod a+x %s" % (DISTRO_SELECT_DEST), user="root")
+    except ExecutionFailed:
+      pass   # Due to concurrent execution, may produce error
 
   def extrakt_var_from_pythonpath(self, name):
 


Mime
View raw message