You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/11/30 19:15:19 UTC
[1/2] ambari git commit: AMBARI-14100. RU and EU upgrade failed on
first step (dlysnichenko)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 4aadb9f71 -> a41f7b250
refs/heads/trunk c838f314d -> 93bf1d370
AMBARI-14100. RU and EU upgrade failed on first step (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/93bf1d37
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/93bf1d37
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/93bf1d37
Branch: refs/heads/trunk
Commit: 93bf1d370c6df7cfd50123c98aa0b8ac0582e962
Parents: c838f31
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Nov 30 20:13:50 2015 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Nov 30 20:14:50 2015 +0200
----------------------------------------------------------------------
.../libraries/functions/conf_select.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/93bf1d37/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
index 9ed5fb8..24ca151 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
@@ -28,7 +28,7 @@ import subprocess
from resource_management.core import shell
from resource_management.libraries.script.script import Script
from resource_management.core.logger import Logger
-from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import Directory, Link
PACKAGE_DIRS = {
"accumulo": [
@@ -259,19 +259,23 @@ def select(stack_name, package, version, try_create=True):
normalized_current_dir = (os.path.normpath(real_path_of_current_dir)).strip()
Logger.info("Normalized Conf Dir : {0}, Normalized Current Dir : {1}".format(normalized_conf_dir, normalized_current_dir))
if os.path.isdir(normalized_current_dir) and normalized_current_dir != normalized_conf_dir:
- if not os.path.isdir(normalized_conf_dir) :
- os.symlink(normalized_current_dir, normalized_conf_dir)
+ if not os.path.isdir(normalized_conf_dir) and not os.path.islink(normalized_conf_dir):
+ Link(normalized_conf_dir,
+ to=normalized_current_dir)
Logger.info("{0} directory doesn't exist. Created Symlink : {1} -> {2}".format(normalized_conf_dir, normalized_conf_dir, normalized_current_dir))
return
# In case, 'normalized_conf_dir' does have a symlink and it's not the one mentioned in 'PACKAGE_DIRS',
# we remove the symlink and make it point to correct symlink.
- if (os.path.islink(normalized_conf_dir) and os.readlink(normalized_conf_dir) != normalized_current_dir):
+ if os.path.islink(normalized_conf_dir) and os.readlink(normalized_conf_dir) != normalized_current_dir:
Logger.info("{0} exists and points to incorrect path {1}".format(normalized_conf_dir, os.readlink(normalized_conf_dir)))
- os.remove(normalized_conf_dir)
+ Link(normalized_conf_dir,
+ action="delete")
Logger.info("Removed existing symlink for {0}".format(normalized_conf_dir))
- os.symlink(normalized_current_dir, normalized_conf_dir)
+ Link(normalized_conf_dir,
+ to=normalized_current_dir)
Logger.info("Created Symlink : {0} -> {1}".format(normalized_conf_dir, normalized_current_dir))
+
def get_hadoop_conf_dir(force_latest_on_upgrade=False):
"""
Gets the shared hadoop conf directory using:
[2/2] ambari git commit: AMBARI-14100. RU and EU upgrade failed on
first step (dlysnichenko)
Posted by dm...@apache.org.
AMBARI-14100. RU and EU upgrade failed on first step (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a41f7b25
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a41f7b25
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a41f7b25
Branch: refs/heads/branch-2.1
Commit: a41f7b250c0802ab7861a2f5f99e12cfb98443f9
Parents: 4aadb9f
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Nov 30 20:11:51 2015 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Nov 30 20:14:55 2015 +0200
----------------------------------------------------------------------
.../libraries/functions/conf_select.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a41f7b25/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
index d868d07..aa72556 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
@@ -28,7 +28,7 @@ import subprocess
from resource_management.core import shell
from resource_management.libraries.script.script import Script
from resource_management.core.logger import Logger
-from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import Directory, Link
PACKAGE_DIRS = {
"accumulo": [
@@ -177,9 +177,11 @@ PACKAGE_DIRS = {
]
}
+
def get_cmd(command, package, version):
return ('conf-select', command, '--package', package, '--stack-version', version, '--conf-version', '0')
+
def _valid(stack_name, package, ver):
if stack_name != "HDP":
return False
@@ -259,19 +261,23 @@ def select(stack_name, package, version, try_create=True):
normalized_current_dir = (os.path.normpath(real_path_of_current_dir)).strip()
Logger.info("Normalized Conf Dir : {0}, Normalized Current Dir : {1}".format(normalized_conf_dir, normalized_current_dir))
if os.path.isdir(normalized_current_dir) and normalized_current_dir != normalized_conf_dir:
- if not os.path.isdir(normalized_conf_dir) :
- os.symlink(normalized_current_dir, normalized_conf_dir)
+ if not os.path.isdir(normalized_conf_dir) and not os.path.islink(normalized_conf_dir):
+ Link(normalized_conf_dir,
+ to=normalized_current_dir)
Logger.info("{0} directory doesn't exist. Created Symlink : {1} -> {2}".format(normalized_conf_dir, normalized_conf_dir, normalized_current_dir))
return
# In case, 'normalized_conf_dir' does have a symlink and it's not the one mentioned in 'PACKAGE_DIRS',
# we remove the symlink and make it point to correct symlink.
- if (os.path.islink(normalized_conf_dir) and os.readlink(normalized_conf_dir) != normalized_current_dir):
+ if os.path.islink(normalized_conf_dir) and os.readlink(normalized_conf_dir) != normalized_current_dir:
Logger.info("{0} exists and points to incorrect path {1}".format(normalized_conf_dir, os.readlink(normalized_conf_dir)))
- os.remove(normalized_conf_dir)
+ Link(normalized_conf_dir,
+ action="delete")
Logger.info("Removed existing symlink for {0}".format(normalized_conf_dir))
- os.symlink(normalized_current_dir, normalized_conf_dir)
+ Link(normalized_conf_dir,
+ to=normalized_current_dir)
Logger.info("Created Symlink : {0} -> {1}".format(normalized_conf_dir, normalized_current_dir))
+
def get_hadoop_conf_dir(force_latest_on_upgrade=False):
"""
Gets the shared hadoop conf directory using: