rewritten as list literals (#2160)

* rewritten as list literals

* added changelog fragment
This commit is contained in:
Alexei Znamensky 2021-04-05 19:22:06 +12:00 committed by GitHub
commit b97e31dd55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 55 additions and 94 deletions

View file

@ -119,20 +119,13 @@ class NicTag(object):
return is_mac(self.mac.lower())
def nictag_exists(self):
cmd = [self.nictagadm_bin]
cmd.append('exists')
cmd.append(self.name)
cmd = [self.nictagadm_bin, 'exists', self.name]
(rc, dummy, dummy) = self.module.run_command(cmd)
return rc == 0
def add_nictag(self):
cmd = [self.nictagadm_bin]
cmd.append('-v')
cmd.append('add')
cmd = [self.nictagadm_bin, '-v', 'add']
if self.etherstub:
cmd.append('-l')
@ -150,10 +143,7 @@ class NicTag(object):
return self.module.run_command(cmd)
def delete_nictag(self):
cmd = [self.nictagadm_bin]
cmd.append('-v')
cmd.append('delete')
cmd = [self.nictagadm_bin, '-v', 'delete']
if self.force:
cmd.append('-f')

View file

@ -72,10 +72,7 @@ class ImageFacts(object):
self.filters = module.params['filters']
def return_all_installed_images(self):
cmd = [self.module.get_bin_path('imgadm')]
cmd.append('list')
cmd.append('-j')
cmd = [self.module.get_bin_path('imgadm'), 'list', '-j']
if self.filters:
cmd.append(self.filters)