Move test command
This commit is contained in:
parent
516117f634
commit
01ae6ee0bf
2 changed files with 8 additions and 11 deletions
|
@ -46,15 +46,6 @@ def main():
|
||||||
elif args.action == 'alert':
|
elif args.action == 'alert':
|
||||||
alert(config, containers)
|
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):
|
def backup(config, containers):
|
||||||
"""Request a backup to start"""
|
"""Request a backup to start"""
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
from .base import BaseCommand
|
from .base import BaseCommand
|
||||||
|
from restic_compose_backup import utils
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
"""Test a command"""
|
"""Test a command"""
|
||||||
name = "test"
|
name = "test"
|
||||||
|
|
||||||
def run(self):
|
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))
|
||||||
|
|
Loading…
Add table
Reference in a new issue