From c7bc20e865271eb862547ffea982398287d6f9ff Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Fri, 15 Jan 2016 13:11:25 +0100 Subject: [PATCH] Split information, that is compatible with the Zypper's output on SLE11. --- salt/modules/zypper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index ccba713f6a..9d654a2a6d 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -164,12 +164,14 @@ def info_available(*names, **kwargs): # Run in batches while batch: cmd = 'zypper info -t package {0}'.format(' '.join(batch[:batch_size])) - pkg_info.extend(re.split(r"----*", __salt__['cmd.run_stdout'](cmd, output_loglevel='trace'))) + pkg_info.extend(re.split(r"Information for package*", __salt__['cmd.run_stdout'](cmd, output_loglevel='trace'))) batch = batch[batch_size:] for pkg_data in pkg_info: nfo = {} for line in [data for data in pkg_data.split("\n") if ":" in data]: + if line.startswith("-----"): + continue kw = [data.strip() for data in line.split(":", 1)] if len(kw) == 2 and kw[1]: nfo[kw[0].lower()] = kw[1]