def call(self, mgr, cmd_dict, inbuf):
kwargs = {}
+ kwargs_switch = False
for a, d in self.args_dict.items():
if 'req' in d and d['req'] == "false" and a not in cmd_dict:
continue
- kwargs[a.replace("-", "_")] = cmd_dict[a]
+ if kwargs_switch or (isinstance(cmd_dict[a], str) and '=' in cmd_dict[a]):
+ mgr.log.debug('found kwarg, assuming all following args are kw style')
+ kwargs_switch = True
+ try:
+ k, arg = cmd_dict[a].split('=')
+ except ValueError as e:
+ mgr.log.error('found positional arg after switching to kwarg parsing')
+ return -errno.EINVAL, '', 'Error EINVAL: postitional arg not allowed after kwarg'
+ kwargs[k.replace("-", "_")] = arg
+ else:
+ kwargs[a.replace("-", "_")] = cmd_dict[a]
if inbuf:
kwargs['inbuf'] = inbuf
assert self.func