Test command for listing swarm nodes

This commit is contained in:
Einar Forselv 2020-03-08 18:36:29 +01:00
parent 07a19f7f42
commit d7492e51f6
1 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,15 @@ def main():
elif args.action == "crontab":
crontab(config)
# Random test stuff here
elif args.action == "test":
nodes = utils.get_swarm_nodes()
print("Swarm nodes:")
for node in nodes:
addr = node.attrs['Status']['Addr']
state = node.attrs['Status']['State']
print(' - {} {} {}'.format(node.id, addr, state))
def status(config, containers):
"""Outputs the backup config for the compose setup"""
@ -283,6 +292,7 @@ def parse_args():
'cleanup',
'version',
'crontab',
'test',
],
)
parser.add_argument(