mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 02:41:25 -07:00
* rewritten as list literals
* added changelog fragment
(cherry picked from commit b97e31dd55
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
055c8dac9c
commit
996ef6ab49
11 changed files with 55 additions and 94 deletions
|
@ -205,9 +205,11 @@ class ResourceRecord(object):
|
|||
def list_record(self, record):
|
||||
# check if the record exists via list on ipwcli
|
||||
search = 'list %s' % (record.replace(';', '&&').replace('set', 'where'))
|
||||
cmd = [self.module.get_bin_path('ipwcli', True)]
|
||||
cmd.append('-user=%s' % (self.user))
|
||||
cmd.append('-password=%s' % (self.password))
|
||||
cmd = [
|
||||
self.module.get_bin_path('ipwcli', True),
|
||||
'-user=%s' % self.user,
|
||||
'-password=%s' % self.password,
|
||||
]
|
||||
rc, out, err = self.module.run_command(cmd, data=search)
|
||||
|
||||
if 'Invalid username or password' in out:
|
||||
|
@ -222,9 +224,11 @@ class ResourceRecord(object):
|
|||
def deploy_record(self, record):
|
||||
# check what happens if create fails on ipworks
|
||||
stdin = 'create %s' % (record)
|
||||
cmd = [self.module.get_bin_path('ipwcli', True)]
|
||||
cmd.append('-user=%s' % (self.user))
|
||||
cmd.append('-password=%s' % (self.password))
|
||||
cmd = [
|
||||
self.module.get_bin_path('ipwcli', True),
|
||||
'-user=%s' % self.user,
|
||||
'-password=%s' % self.password,
|
||||
]
|
||||
rc, out, err = self.module.run_command(cmd, data=stdin)
|
||||
|
||||
if 'Invalid username or password' in out:
|
||||
|
@ -238,9 +242,11 @@ class ResourceRecord(object):
|
|||
def delete_record(self, record):
|
||||
# check what happens if create fails on ipworks
|
||||
stdin = 'delete %s' % (record.replace(';', '&&').replace('set', 'where'))
|
||||
cmd = [self.module.get_bin_path('ipwcli', True)]
|
||||
cmd.append('-user=%s' % (self.user))
|
||||
cmd.append('-password=%s' % (self.password))
|
||||
cmd = [
|
||||
self.module.get_bin_path('ipwcli', True),
|
||||
'-user=%s' % self.user,
|
||||
'-password=%s' % self.password,
|
||||
]
|
||||
rc, out, err = self.module.run_command(cmd, data=stdin)
|
||||
|
||||
if 'Invalid username or password' in out:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue