Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 a63ee0e58 -> bb47934b0


AMABRI-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/bb47934b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bb47934b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bb47934b

Branch: refs/heads/branch-2.6
Commit: bb47934b0ad1e69008582851e67d1d7a4ffbdaa3
Parents: a63ee0e
Author: Dmytro Grinenko <hapyles...@apache.org>
Authored: Fri Dec 8 17:49:55 2017 +0200
Committer: Dmytro Grinenko <hapyles...@apache.org>
Committed: Fri Dec 8 17:49:55 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb47934b/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 ec37536..da2a3b1 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:

Reply via email to