Skip to content
Permalink
Browse files

Fix subcommands with no options (e.g. pubcheck-linked)

  • Loading branch information...
citrus-it authored and pyhalov committed Aug 10, 2019
1 parent 5c93495 commit 51cc1f401fc47c9dd734780e15272cdd03e6ed87
Showing with 17 additions and 15 deletions.
  1. +1 −1 src/client.py
  2. +15 −13 src/modules/client/client_api.py
  3. +1 −1 src/modules/client/options.py
@@ -5857,7 +5857,7 @@ def main_func():
# Get the available options for the requested operation to create the
# getopt parsing strings.
valid_opts = options.get_pkg_opts(subcommand, add_table=cmd_opts)
if not valid_opts:
if valid_opts is None:
# if there are no options for an op, it has its own processing
try:
return func(api_inst, pargs)
@@ -130,21 +130,23 @@ def _get_pkg_output_schema(subcommand):

def __get_pkg_input_schema(pkg_op, opts_mapping=misc.EmptyDict):
properties = {}
for entry in options.pkg_op_opts[pkg_op]:
if type(entry) != tuple:
continue
if len(entry) == 4:
opt, dummy_default, dummy_valid_args, \
schema = entry

if opt in opts_mapping:
optn = opts_mapping[opt]
if optn:
properties[optn] = schema
opts = options.pkg_op_opts[pkg_op]
if opts is not None:
for entry in opts:
if type(entry) != tuple:
continue
if len(entry) == 4:
opt, dummy_default, dummy_valid_args, \
schema = entry

if opt in opts_mapping:
optn = opts_mapping[opt]
if optn:
properties[optn] = schema
else:
properties[opt] = schema
else:
properties[opt] = schema
else:
properties[opt] = schema

arg_name = "pargs_json"
input_schema = \
@@ -1336,7 +1336,7 @@ def opts_table_cb_actuators(api_inst, opts, opts_new):
pkgdefs.PKG_OP_SET_PROP_LINKED: opts_set_property_linked,
pkgdefs.PKG_OP_SYNC : opts_sync_linked,
pkgdefs.PKG_OP_UNINSTALL : opts_uninstall,
pkgdefs.PKG_OP_UNSET_PUBLISHER: [],
pkgdefs.PKG_OP_UNSET_PUBLISHER: None,
pkgdefs.PKG_OP_UPDATE : opts_update,
pkgdefs.PKG_OP_APPLY_HOT_FIX : opts_apply_hot_fix,
pkgdefs.PKG_OP_VERIFY : opts_verify

0 comments on commit 51cc1f4

Please sign in to comment.
You can’t perform that action at this time.