Пример #1
0
    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"))
Пример #2
0
    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"))
Пример #3
0
 def run(self, context, args, kwargs, opargs):
     output_dict(context.call_sync('system.info.hardware'))
Пример #4
0
 def run(self, context, args, kwargs, opargs):
     output_dict(context.call_sync('management.status'))