mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
* ip_netns - invoke run_command passing list
* added changelog fragment
(cherry picked from commit ba9578f12a)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
2
changelogs/fragments/3822-ip_netns-run-list.yaml
Normal file
2
changelogs/fragments/3822-ip_netns-run-list.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
minor_changes:
|
||||||
|
- ip_netns - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3822).
|
||||||
@@ -76,7 +76,7 @@ class Namespace(object):
|
|||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
'''Check if the namespace already exists'''
|
'''Check if the namespace already exists'''
|
||||||
rc, out, err = self.module.run_command('ip netns list')
|
rc, out, err = self.module.run_command(['ip', 'netns', 'list'])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
self.module.fail_json(msg=to_text(err))
|
self.module.fail_json(msg=to_text(err))
|
||||||
return self.name in out
|
return self.name in out
|
||||||
|
|||||||
Reference in New Issue
Block a user