You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by am...@apache.org on 2017/12/12 15:14:31 UTC

[10/24] ambari git commit: AMBARI-22616 noplugins switch should not be used for yum repos backed by RedHat Satellite/Spacewalk (dgrinenko)

AMBARI-22616 noplugins switch should not be used for yum repos backed by RedHat Satellite/Spacewalk (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 9f2924bc8bd3002cd8470eb875afcb47ec0cf208
Parents: e170fac
Author: Dmytro Grinenko <ha...@apache.org>
Authored: Fri Dec 8 16:30:46 2017 +0200
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Tue Dec 12 16:13:58 2017 +0100

----------------------------------------------------------------------
 .../core/providers/package/yumrpm.py                   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9f2924bc/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
index c83a3ce..3742ff6 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
@@ -52,8 +52,8 @@ YUM_TR_PREFIX = "transaction-"
 
 YUM_REPO_LOCATION = "/etc/yum.repos.d"
 REPO_UPDATE_CMD = ['/usr/bin/yum', 'clean', 'metadata']
-ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed", "--noplugins"]
-ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available", "--noplugins"]
+ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed"]
+ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available"]
 VERIFY_DEPENDENCY_CMD = ['/usr/bin/yum', '-d', '0', '-e', '0', 'check', 'dependencies']
 
 # base command output sample:
@@ -191,7 +191,14 @@ class YumProvider(RPMBasedPackageProvider):
       for line in lines[skip_index:]:
         items = items + line.strip(' \t\n\r').split()
 
-      for i in range(0, len(items), 3):
+      items_count = len(items)
+
+      for i in range(0, items_count, 3):
+
+        # check if we reach the end
+        if i+3 > items_count:
+          break
+
         if '.' in items[i]:
           items[i] = items[i][:items[i].rindex('.')]
         if items[i + 2].find('@') == 0: