updated modules
This commit is contained in:
parent
4560f9d1fe
commit
8170ebddd1
@ -145,7 +145,7 @@ def domain_put_record(zone="",
|
||||
subDomain=subDomain)
|
||||
if len(records) > 0:
|
||||
record = client.get(f'/domain/zone/{zone}/record/{records[0]}')
|
||||
req = client.put(f'/domain/zone/{zone}/record/{records[0]["id"]}',
|
||||
req = client.put(f'/domain/zone/{zone}/record/{record["id"]}',
|
||||
subDomain=subDomain,
|
||||
target=target,
|
||||
ttl=ttl)
|
||||
|
@ -53,24 +53,29 @@ def domain_record_present(name,
|
||||
res = __salt__['ovhapi.domain_put_record'](zone=zone,
|
||||
fieldType=recordtype,
|
||||
subDomain=recordname)
|
||||
res_output = f"Updated record {recordname}, output: {res_output}"
|
||||
new_zone_state = __salt__['ovhapi.domain_get_zone'](zone=zone)
|
||||
|
||||
ret['changes'] = {
|
||||
"diff": salt.utils.stringutils.get_diff(_str_split(cur_zone_state),
|
||||
_str_split(new_zone_state))
|
||||
}
|
||||
res_output = f"Updated record {recordname}"
|
||||
else:
|
||||
res = __salt__['ovhapi.domain_post_record'](zone=zone,
|
||||
subDomain=recordname,
|
||||
fieldType=recordtype,
|
||||
target=target,
|
||||
ttl=ttl)
|
||||
res_output = f"Updated record {recordname}, output: {res_output}"
|
||||
new_zone_state = __salt__['ovhapi.domain_get_zone'](zone=zone)
|
||||
|
||||
new_zone_state = __salt__['ovhapi.domain_get_zone'](zone=zone)
|
||||
ret['changes'] = {
|
||||
"diff": salt.utils.stringutils.get_diff(_str_split(cur_zone_state),
|
||||
_str_split(new_zone_state))
|
||||
}
|
||||
res_output = f"Created record {recordname}"
|
||||
|
||||
cur_zone_refresh = __salt__['ovhapi.domain_refresh_zone'](zone=zone)
|
||||
|
||||
ret['changes'] = {
|
||||
"diff": salt.utils.stringutils.get_diff(_str_split(cur_zone_state),
|
||||
_str_split(new_zone_state))
|
||||
}
|
||||
ret['comment'] = f'Result is {res_output}, refresh {cur_zone_refresh}'
|
||||
ret['comment'] = f'Result is {res_output}'
|
||||
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user