def run(self, context, args, kwargs, opargs): if len(args) == 0: output_dict(dict(context.variables.get_all_printable())) if len(args) == 1: try: # Yes, the manual call to __str__() is needed as the output_msg # in some formatters (ascii) replies on cprint instead of print # thus making it a no-go to rely directly on __str__ to be # invoked! return context.variables.variables[args[0]].value except KeyError: raise CommandException(_("No such Environment Variable exists"))
def run(self, context, args, kwargs, opargs): if len(args) == 0: output_dict(dict(context.variables.get_all_printable())) if len(args) == 1: try: # Yes, the manual call to __str__() is needed as the output_msg # in some formatters (ascii) replies on cprint instead of print # thus making it a no-go to rely directly on __str__ to be # invoked! return context.variables.variables[args[0]].value except KeyError: raise CommandException( _("No such Environment Variable exists"))
def run(self, context, args, kwargs, opargs): output_dict(context.call_sync('system.info.hardware'))
def run(self, context, args, kwargs, opargs): output_dict(context.call_sync('management.status'))