Skip to content

Commit 9613c47

Browse files
authored
Add sync ceph-keys command (#1753)
Signed-off-by: Christian Berendt <[email protected]>
1 parent 0ff8154 commit 9613c47

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

osism/commands/sync.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ def take_action(self, parsed_args):
2424
return rc
2525

2626

27+
class CephKeys(Command):
28+
def get_parser(self, prog_name):
29+
parser = super(CephKeys, self).get_parser(prog_name)
30+
parser.add_argument(
31+
"--no-wait",
32+
default=False,
33+
help="Do not wait until the sync has been completed",
34+
action="store_true",
35+
)
36+
return parser
37+
38+
def take_action(self, parsed_args):
39+
# Check if tasks are locked before proceeding
40+
utils.check_task_lock_and_exit()
41+
42+
wait = not parsed_args.no_wait
43+
arguments = []
44+
t = ansible.run.delay(
45+
"manager", "copy-ceph-keys", arguments, auto_release_time=3600
46+
)
47+
logger.info(f"Task {t.task_id} (sync ceph-keys) started")
48+
rc = handle_task(t, wait)
49+
return rc
50+
51+
2752
class Sonic(Command):
2853
def get_parser(self, prog_name):
2954
parser = super(Sonic, self).get_parser(prog_name)

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ osism.commands:
117117
sonic show = osism.commands.sonic:Show
118118
sonic sync= osism.commands.sync:Sonic
119119
sonic ztp = osism.commands.sonic:Ztp
120+
sync ceph-keys = osism.commands.sync:CephKeys
120121
sync configuration = osism.commands.configuration:Sync
121122
sync dnsmasq = osism.commands.manage:Dnsmasq
122123
sync facts = osism.commands.sync:Facts

0 commit comments

Comments
 (0)