Пример #1
0
 def execute(self, args):
     hardware = HardwareManager(self.client)
     hardware_id = resolve_id(
         hardware.resolve_ids, args.get('<identifier>'), 'hardware')
     keys = []
     if args.get('--key'):
         for key in args.get('--key'):
             key_id = resolve_id(SshKeyManager(self.client).resolve_ids,
                                 key, 'SshKey')
             keys.append(key_id)
     if args['--really'] or no_going_back(hardware_id):
         hardware.reload(hardware_id, args['--postinstall'], keys)
     else:
         CLIAbort('Aborted')
Пример #2
0
    def execute(self, args):
        mgr = HardwareManager(self.client)
        hw_id = resolve_id(
            mgr.resolve_ids, args.get('<identifier>'), 'hardware')

        comment = args.get('--comment')

        if not comment and not args['--really']:
            comment = self.env.input("(Optional) Add a cancellation comment:")

        reason = args.get('--reason')

        if args['--really'] or no_going_back(hw_id):
            mgr.cancel_hardware(hw_id, reason, comment)
        else:
            CLIAbort('Aborted')
Пример #3
0
 def execute(self, args):
     manager = SSLManager(self.client)
     if args['--really'] or no_going_back('yes'):
         manager.remove_certificate(args['<id>'])
     raise CLIAbort("Aborted.")
Пример #4
0
 def execute(client, args):
     manager = SSLManager(client)
     if args['--really'] or no_going_back('yes'):
         manager.remove_certificate(args['<id>'])
         return "Deleted certificate: %s" % args['<id>']
     raise CLIAbort("Aborted.")