File 0015-Check-for-single-quote-before-splitting-on-single-qu.patch of Package salt.4663

From 25f847388e4ccfa61f8f43e1ff7efd8424d9635a Mon Sep 17 00:00:00 2001
From: Eric Jackson <swiftgist@gmail.com>
Date: Tue, 30 Aug 2016 15:47:07 -0400
Subject: [PATCH 15/38] 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 50d3b8d..9120ebd 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -868,11 +868,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.10.2

openSUSE Build Service is sponsored by