ip_netns - invoke run_command passing list (#3822)

* ip_netns - invoke run_command passing list

* added changelog fragment
pull/3833/head
Alexei Znamensky 2021-12-01 19:10:46 +13:00 committed by GitHub
parent c587d21ba0
commit ba9578f12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View 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).

View File

@ -76,7 +76,7 @@ class Namespace(object):
def exists(self):
'''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:
self.module.fail_json(msg=to_text(err))
return self.name in out