Skip to content

Commit

Permalink
Update deploy to reflect new command format
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Jan 2, 2024
1 parent 53098bd commit 9a57303
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions control/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,38 @@ def open_rados_connection(self, config):
help="Path to config file",
)
parser.add_argument(
"-D",
"--deployment",
"-g",
"--gateway",
required=True,
type=str,
help="Create set of Gateway names",
help="gateway id",
)
parser.add_argument(
"-p",
"--pool",
required=True,
type=str,
help="gateway pool",
)
parser.add_argument(
"-G",
"--group",
default='',
type=str,
help="gateway group",
)
subparsers = parser.add_subparsers(dest="subcommand")
valid_commands = ['create', 'delete']
for cmd in valid_commands:
subparsers.add_parser(cmd, help=f'{cmd} nvmeof gateway deployement')
subparsers.add_parser(cmd, help=f'{cmd} nvmeof gateway create/delete')

args = parser.parse_args()
config = GatewayConfig(args.config)
gw_str = args.deployment
cmd = args.subcommand
if cmd not in valid_commands:
print(f'Valid commands are {valid_commands}. Use --help for usage information.')
raise SystemExit

print (f"{config=} {cmd=} {gw_str=}")
print (f"{config=} {cmd=} {args.gateway=} {args.pool=} {args.group=}")
rads = RadosConn(config)
rads.conn.mon_command('{"prefix":"nvme-gw ' + cmd + '","ids":[' + gw_str + ']}', b'')
rads.conn.mon_command(f'{"prefix":"nvme-gw {cmd}","id":"{args.gateway}", "group": "{args.group}", "pool": "{args.pool}"}', b'')

0 comments on commit 9a57303

Please sign in to comment.