Move test command

This commit is contained in:
einarf 2023-03-09 01:24:25 +01:00
parent 516117f634
commit 01ae6ee0bf
2 changed files with 8 additions and 11 deletions

View File

@ -46,15 +46,6 @@ def main():
elif args.action == 'alert':
alert(config, containers)
# 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 backup(config, containers):
"""Request a backup to start"""

View File

@ -1,9 +1,15 @@
from .base import BaseCommand
from restic_compose_backup import utils
class Command(BaseCommand):
"""Test a command"""
name = "test"
def run(self):
print("Test!")
"""Random test command"""
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))