Skip to content

Commit d98f951

Browse files
committed
fix warnings
1 parent e115351 commit d98f951

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

plugins/modules/k8s_drain.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ def _revert_node_patch():
441441
warnings.append(warn)
442442
result.append("{0} Pod(s) deleted from node.".format(number_pod))
443443
if warnings:
444-
for w in warnings:
445-
self._module.warn(w)
444+
self._module.warn(warnings)
446445
return dict(result=" ".join(result))
447446

448447
def patch_node(self, unschedulable):

plugins/modules/k8s_rollback.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ def perform_action(svc, resource):
169169
resource["metadata"]["name"],
170170
)
171171
if warn:
172-
for w in warn:
173-
module.warn(w)
172+
module.warn(warn)
174173
result = {"changed": False}
175174
return result
176175

plugins/modules/k8s_scale.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ def _continue_or_fail(error):
244244

245245
def _continue_or_exit(warn):
246246
if warn:
247-
for w in warn:
248-
module.warn(w)
247+
module.warn(warn)
249248
if multiple_scale:
250249
return_attributes["results"].append({"changed": False})
251250
else:

tests/integration/targets/k8s_rollback/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
that:
412412
- not result.changed
413413
- result.rollback_info[0].warnings is defined
414-
- "'No rollout history found' in result.rollback_info[0].warnings[0]"
414+
- "'No rollout history found' in result.warnings.warnings[0]"
415415

416416
- name: Create a service for unsupported resource test
417417
k8s:

0 commit comments

Comments
 (0)