ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [22/31] ambari git commit: AMBARI-13322. Should not log "unable to get latest URL" as ERROR (aonishuk)
Date Wed, 07 Oct 2015 13:52:03 GMT
AMBARI-13322. Should not log "unable to get latest URL" as ERROR (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ebccd7224d53ce4178c57cb0fa6379d6a6470c3b
Parents: 815c5ca
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Oct 6 15:16:13 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Oct 6 15:16:13 2015 +0300

----------------------------------------------------------------------
 .../core/providers/system.py                    | 24 +-------------------
 .../core/resources/system.py                    |  1 -
 .../server/state/stack/LatestRepoCallable.java  |  5 ++--
 3 files changed, 4 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-common/src/main/python/resource_management/core/providers/system.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/system.py b/ambari-common/src/main/python/resource_management/core/providers/system.py
index d53779c..a3b01f0 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/system.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/system.py
@@ -149,11 +149,7 @@ class DirectoryProvider(Provider):
           Logger.info("Following the link {0} to {1} to create the directory".format(self.resource.path,
path))
 
       if self.resource.recursive:
-        if self.resource.recursive_permission:
-          DirectoryProvider.makedirs_and_set_permission_recursively(path, self.resource.owner,
-                                                                    self.resource.group,
self.resource.mode)
-        else:
-          sudo.makedirs(path, self.resource.mode or 0755)
+        sudo.makedirs(path, self.resource.mode or 0755)
       else:
         dirname = os.path.dirname(path)
         if not sudo.path_isdir(dirname):
@@ -167,24 +163,6 @@ class DirectoryProvider(Provider):
     _ensure_metadata(path, self.resource.owner, self.resource.group,
                         mode=self.resource.mode, cd_access=self.resource.cd_access)
 
-  @staticmethod
-  def makedirs_and_set_permission_recursively(path, owner, group, mode):
-    folders = []
-    path, folder = os.path.split(path)
-    while folder != "":
-      folders.append(folder)
-      path, folder = os.path.split(path)
-    if path != "":
-      folders.append(path)
-
-    folders.reverse()
-    dir_prefix = ""
-    for folder in folders:
-      dir_prefix = os.path.join(dir_prefix, folder)
-      if not sudo.path_exists(dir_prefix):
-        sudo.makedir(dir_prefix, mode or 0755)
-        _ensure_metadata(dir_prefix, None, None, mode)
-
   def action_delete(self):
     path = self.resource.path
     if sudo.path_exists(path):

http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-common/src/main/python/resource_management/core/resources/system.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/resources/system.py b/ambari-common/src/main/python/resource_management/core/resources/system.py
index f74e258..83abc64 100644
--- a/ambari-common/src/main/python/resource_management/core/resources/system.py
+++ b/ambari-common/src/main/python/resource_management/core/resources/system.py
@@ -60,7 +60,6 @@ class Directory(Resource):
   group = ResourceArgument()
   follow = BooleanArgument(default=True) # follow links?
   recursive = BooleanArgument(default=False) # this work for 'create', 'delete' is anyway
recursive
-  recursive_permission = BooleanArgument(default=False) # sets given perms to all non-existent
folders which are created recursively
   """
   Grants x-bit for all the folders up-to the directory
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
index cd7d229..0ad24fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
@@ -90,8 +90,9 @@ public class LatestRepoCallable implements Callable<Void> {
         }
       }
     } catch (Exception e) {
-      LOG.error("Could not load the URI for stack " + stack.getName() + "-" +
-              stack.getVersion() + " from " + sourceUri + " (" + e.getMessage() + ")");
+      LOG.info("Could not load the URI for stack " + stack.getName() + "-" +
+              stack.getVersion() + " from " + sourceUri + " (" + e.getMessage() + ")" +
+              ". Using default repository values.");
       throw e;
     }
 


Mime
View raw message