salt/bugfix-always-return-a-string-list-on-unknown-job-ta.patch

69 lines
2.8 KiB
Diff
Raw Normal View History

From 49a4e807fb1cb844cec7b7c11b37f6c276f899e4 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Mon, 9 Oct 2017 17:57:48 +0200
Accepting request 540260 from systemsmanagement:saltstack:products:unstable.py3 - Update to 2017.7.2 See https://docs.saltstack.com/en/latest/topics/releases/2017.7.2.html - Added: * enable-with-salt-version-parameter-for-setup.py-scri.patch - Removed: * add-a-salt-minion-service-control-file.patch * add-clean_id-function-to-salt.utils.verify.py.patch * add-options-for-dockerng.patch * add-ssh-option-to-salt-ssh.patch * add-unit-test-for-skip-false-values-from-preferred_i.patch * add-yum-plugin.patch * add-zypp-notify-plugin.patch * adding-salt-minion-watchdog-for-sysv-systems-rhel6-a.patch * adding-support-for-installing-patches-in-yum-dnf-exe.patch * avoid-failures-on-sles-12-sp2-because-of-new-systemd.patch * bugfix-jobs-scheduled-to-run-at-a-future-time-stay-p.patch * bugfix-unable-to-use-127-as-hostname.patch * catching-error-when-pidfile-cannot-be-deleted.patch * change-travis-configuration-file-to-use-salt-toaster.patch * check-if-byte-strings-are-properly-encoded-in-utf-8.patch * clean-up-change-attribute-from-interface-dict.patch * do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch * enables-salt-minion-watchdog-on-init.d-script-for-sy.patch * escape-the-os.sep.patch * fix-for-delete_deployment-in-kubernetes-module.patch * fix-format-error-bsc-1043111.patch * fix-grain-for-os_family-on-suse-series.patch * fix-os_family-case-in-unittest.patch * fix-regression-in-file.get_managed-add-unit-tests.patch * fix-salt-summary-to-count-not-responding-minions-cor.patch OBS-URL: https://build.opensuse.org/request/show/540260 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=98
2017-11-10 08:17:55 +01:00
Subject: [PATCH 5/6] 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.14.2