Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B75AC17B79 for ; Wed, 7 Oct 2015 13:51:47 +0000 (UTC) Received: (qmail 74368 invoked by uid 500); 7 Oct 2015 13:51:44 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 74292 invoked by uid 500); 7 Oct 2015 13:51:44 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 73528 invoked by uid 99); 7 Oct 2015 13:51:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Oct 2015 13:51:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 59E7AE0BB0; Wed, 7 Oct 2015 13:51:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Wed, 07 Oct 2015 13:52:03 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/31] ambari git commit: AMBARI-13322. Should not log "unable to get latest URL" as ERROR (aonishuk) 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 Authored: Tue Oct 6 15:16:13 2015 +0300 Committer: Andrew Onishuk 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 { } } } 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; }