salt/0017-Check-for-single-quote-before-splitting-on-single-qu.patch

36 lines
1.1 KiB
Diff
Raw Normal View History

From e9b4a199f48abc94be71082c56b6b059c6694dc0 Mon Sep 17 00:00:00 2001
From: Eric Jackson <swiftgist@gmail.com>
Date: Tue, 30 Aug 2016 15:47:07 -0400
Subject: [PATCH 17/17] Check for single quote before splitting on single quote
Signed-off-by: Eric Jackson <ejackson@suse.com>
Lint for #35916
Merges #35916
---
salt/modules/zypper.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 1ec903e..4bb9a09 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -859,11 +859,11 @@ def refresh_db():
for line in out.splitlines():
if not line:
continue
- if line.strip().startswith('Repository'):
+ if line.strip().startswith('Repository') and '\'' in line:
key = line.split('\'')[1].strip()
if 'is up to date' in line:
ret[key] = False
- elif line.strip().startswith('Building'):
+ elif line.strip().startswith('Building') and '\'' in line:
key = line.split('\'')[1].strip()
if 'done' in line:
ret[key] = True
--
2.8.2