mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
autodns dryrun: return a proper dict/list structure instead of a raw string
This commit is contained in:
parent
96b112ac7f
commit
86a74903db
1 changed files with 3 additions and 4 deletions
|
@ -717,13 +717,12 @@ def domain_registrar_push(operation_logger, domain, dry_run=False, autoremove=Fa
|
||||||
return f'{name:>20} [{t:^5}] {old_content:^30} -> {new_content:^30}'
|
return f'{name:>20} [{t:^5}] {old_content:^30} -> {new_content:^30}'
|
||||||
|
|
||||||
if dry_run:
|
if dry_run:
|
||||||
out = []
|
out = {"delete": [], "create": [], "update": [], "ignored": []}
|
||||||
for action in ["delete", "create", "update"]:
|
for action in ["delete", "create", "update"]:
|
||||||
out.append("\n" + action + ":\n")
|
|
||||||
for record in changes[action]:
|
for record in changes[action]:
|
||||||
out.append(human_readable_record(action, record))
|
out[action].append(human_readable_record(action, record))
|
||||||
|
|
||||||
return '\n'.join(out)
|
return out
|
||||||
|
|
||||||
operation_logger.start()
|
operation_logger.start()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue