示例#1
0
 def do_device(self, line):
     """Enter device level command mode"""
     device_id = line.strip() or self.default_device_id
     if not device_id:
         raise Exception('<device-id> parameter needed')
     sub = DeviceCli(self.get_channel, device_id)
     sub.cmdloop()
示例#2
0
 def do_device(self, line):
     """Enter device level command mode"""
     device_id = line.strip() or self.default_device_id
     if not device_id:
         raise Exception('<device-id> parameter needed')
     sub = DeviceCli(device_id, self.get_stub)
     sub.cmdloop()
示例#3
0
 def do_device(self, line):
     """Enter device level command mode"""
     device_id = line.strip() or self.default_device_id
     if not device_id:
         raise Exception('<device-id> parameter needed')
     if device_id not in self.device_ids():
         self.poutput( self.colorize('Error: ', 'red') +
                         'There is no such device')
         raise Exception('<device-id> is not a valid one')
     sub = DeviceCli(device_id, self.get_stub)
     sub.cmdloop()