You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/11/24 14:48:23 UTC
[1/2] ambari git commit: AMBARI-14039. RU install_packages fails on
suse (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 b689cdc25 -> f5f129d5e
refs/heads/trunk 37a3b9152 -> b20ae5fe1
AMBARI-14039. RU install_packages fails on suse (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b20ae5fe
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b20ae5fe
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b20ae5fe
Branch: refs/heads/trunk
Commit: b20ae5fe1ed70560007af4c8c10741b855bfd2a3
Parents: 37a3b91
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Nov 24 15:48:06 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Nov 24 15:48:06 2015 +0200
----------------------------------------------------------------------
.../core/providers/package/zypper.py | 27 ++++++++++----------
1 file changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b20ae5fe/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
index b255254..1fbc9bf 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
@@ -37,25 +37,12 @@ REMOVE_CMD = {
LIST_ACTIVE_REPOS_CMD = ['/usr/bin/zypper', 'repos']
-def get_active_base_repos():
- (code, output) = self.call_until_not_locked(LIST_ACTIVE_REPOS_CMD)
- enabled_repos = []
- if not code:
- for line in output.split('\n')[2:]:
- line_list = line.split('|')
- if line_list[3].strip() == 'Yes' and line_list[2].strip().startswith("SUSE-"):
- enabled_repos.append(line_list[1].strip())
- if line_list[2].strip() == 'OpenSuse':
- return [line_list[1].strip()]
- return enabled_repos
-
-
class ZypperProvider(PackageProvider):
def install_package(self, name, use_repos=[], skip_repos=[]):
if use_repos or not self._check_existence(name):
cmd = INSTALL_CMD[self.get_logoutput()]
if use_repos:
- active_base_repos = get_active_base_repos()
+ active_base_repos = self.get_active_base_repos()
if 'base' in use_repos:
# Remove 'base' from use_repos list
use_repos = filter(lambda x: x != 'base', use_repos)
@@ -82,6 +69,18 @@ class ZypperProvider(PackageProvider):
else:
Logger.info("Skipping removal of non-existing package %s" % (name))
+ def get_active_base_repos(self):
+ (code, output) = self.call_until_not_locked(LIST_ACTIVE_REPOS_CMD)
+ enabled_repos = []
+ if not code:
+ for line in output.split('\n')[2:]:
+ line_list = line.split('|')
+ if line_list[3].strip() == 'Yes' and line_list[2].strip().startswith("SUSE-"):
+ enabled_repos.append(line_list[1].strip())
+ if line_list[2].strip() == 'OpenSuse':
+ return [line_list[1].strip()]
+ return enabled_repos
+
def is_locked_output(self ,out):
return "System management is locked by the application" in out
[2/2] ambari git commit: AMBARI-14039. RU install_packages fails on
suse (aonishuk)
Posted by ao...@apache.org.
AMBARI-14039. RU install_packages fails on suse (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f5f129d5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f5f129d5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f5f129d5
Branch: refs/heads/branch-2.1
Commit: f5f129d5e8683fb2b84dca1d459cfe64d2718deb
Parents: b689cdc
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Nov 24 15:48:11 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Nov 24 15:48:11 2015 +0200
----------------------------------------------------------------------
.../core/providers/package/zypper.py | 27 ++++++++++----------
1 file changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f5f129d5/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
index b255254..1fbc9bf 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
@@ -37,25 +37,12 @@ REMOVE_CMD = {
LIST_ACTIVE_REPOS_CMD = ['/usr/bin/zypper', 'repos']
-def get_active_base_repos():
- (code, output) = self.call_until_not_locked(LIST_ACTIVE_REPOS_CMD)
- enabled_repos = []
- if not code:
- for line in output.split('\n')[2:]:
- line_list = line.split('|')
- if line_list[3].strip() == 'Yes' and line_list[2].strip().startswith("SUSE-"):
- enabled_repos.append(line_list[1].strip())
- if line_list[2].strip() == 'OpenSuse':
- return [line_list[1].strip()]
- return enabled_repos
-
-
class ZypperProvider(PackageProvider):
def install_package(self, name, use_repos=[], skip_repos=[]):
if use_repos or not self._check_existence(name):
cmd = INSTALL_CMD[self.get_logoutput()]
if use_repos:
- active_base_repos = get_active_base_repos()
+ active_base_repos = self.get_active_base_repos()
if 'base' in use_repos:
# Remove 'base' from use_repos list
use_repos = filter(lambda x: x != 'base', use_repos)
@@ -82,6 +69,18 @@ class ZypperProvider(PackageProvider):
else:
Logger.info("Skipping removal of non-existing package %s" % (name))
+ def get_active_base_repos(self):
+ (code, output) = self.call_until_not_locked(LIST_ACTIVE_REPOS_CMD)
+ enabled_repos = []
+ if not code:
+ for line in output.split('\n')[2:]:
+ line_list = line.split('|')
+ if line_list[3].strip() == 'Yes' and line_list[2].strip().startswith("SUSE-"):
+ enabled_repos.append(line_list[1].strip())
+ if line_list[2].strip() == 'OpenSuse':
+ return [line_list[1].strip()]
+ return enabled_repos
+
def is_locked_output(self ,out):
return "System management is locked by the application" in out