salt/bugfix-always-return-a-string-list-on-unknown-job-ta.patch
Pablo Suárez Hernández b17d3e3575 Accepting request 569868 from systemsmanagement:saltstack:testing
- Fix the usage of custom macros on the spec file.

- Fix RES7: different dependency names for python-PyYAML
  and python-MarkupSafe

- Build both python2 and python3 binaries together.

- Bugfix: errors in external pillar causes crash instead of report
  of them (bsc#1068446)
- Fix 'user.present' when 'gid_from_name' is set but group does
  not exist.
- Added:
 * bugfix-the-logic-according-to-the-exact-described-pu.patch
 * return-error-when-gid_from_name-and-group-does-not-e.patch

- Fix "No service execution module loaded" issue (bsc#1065792)
- Set SHELL environment variable
  Added:
  * fix-bsc-1065792.patch
  * set-shell-environment-variable-64.patch

- Removed unnecessary logging on shutdown (bsc#1050003)
- Renamed patch that adds grain fqdns
  Changed:
  * catching-error-when-pidfile-cannot-be-deleted
  Removed:
  * fix-for-pidfile-removal-logging
  Renamed:
  * add-fqdns-grains -> feat-add-grain-for-all-fqdns

OBS-URL: https://build.opensuse.org/request/show/569868
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=107
2018-01-26 13:46:21 +00:00

70 lines
2.8 KiB
Diff

From 49a4e807fb1cb844cec7b7c11b37f6c276f899e4 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Mon, 9 Oct 2017 17:57:48 +0200
Subject: [PATCH] Bugfix: always return a string "list" on unknown job
target type.
---
salt/returners/couchbase_return.py | 2 +-
salt/returners/postgres_local_cache.py | 2 +-
salt/runners/jobs.py | 2 +-
salt/utils/jid.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/salt/returners/couchbase_return.py b/salt/returners/couchbase_return.py
index 24c3a9105a..f5adecc2e7 100644
--- a/salt/returners/couchbase_return.py
+++ b/salt/returners/couchbase_return.py
@@ -309,7 +309,7 @@ def _format_job_instance(job):
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
- 'Target-type': job.get('tgt_type', []),
+ 'Target-type': job.get('tgt_type', 'list'),
'User': job.get('user', 'root')}
if 'metadata' in job:
diff --git a/salt/returners/postgres_local_cache.py b/salt/returners/postgres_local_cache.py
index 422f8c77c7..28dc2f565c 100644
--- a/salt/returners/postgres_local_cache.py
+++ b/salt/returners/postgres_local_cache.py
@@ -180,7 +180,7 @@ def _format_job_instance(job):
'Arguments': json.loads(job.get('arg', '[]')),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
- 'Target-type': job.get('tgt_type', []),
+ 'Target-type': job.get('tgt_type', 'list'),
'User': job.get('user', 'root')}
# TODO: Add Metadata support when it is merged from develop
return ret
diff --git a/salt/runners/jobs.py b/salt/runners/jobs.py
index 82abd56eae..fae7942e38 100644
--- a/salt/runners/jobs.py
+++ b/salt/runners/jobs.py
@@ -542,7 +542,7 @@ def _format_job_instance(job):
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
- 'Target-type': job.get('tgt_type', []),
+ 'Target-type': job.get('tgt_type', 'list'),
'User': job.get('user', 'root')}
if 'metadata' in job:
diff --git a/salt/utils/jid.py b/salt/utils/jid.py
index 3f4ef296a2..4dbf0d2c6f 100644
--- a/salt/utils/jid.py
+++ b/salt/utils/jid.py
@@ -65,7 +65,7 @@ def format_job_instance(job):
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
- 'Target-type': job.get('tgt_type', []),
+ 'Target-type': job.get('tgt_type', 'list'),
'User': job.get('user', 'root')}
if 'metadata' in job:
--
2.15.1