~nuclearbob/ubuntu-test-cases/bootspeed-nfss

« back to all changes in this revision

Viewing changes to scripts/get-device-info

MergedĀ upstreamĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
 
7
7
def _get_state(args):
8
 
    print(device_info.get_state(device_info.get_serial(args.name)))
 
8
    device = device_info.get_device(args.name)
 
9
    print(device.get_state())
9
10
 
10
11
 
11
12
def _get_serial(args):
12
 
    print(device_info.get_serial(args.name))
13
 
 
14
 
 
15
 
def _get_power(args):
16
 
    print(device_info.get_power(args.name))
 
13
    device = device_info.get_device(args.name)
 
14
    print(device.get_serial())
17
15
 
18
16
 
19
17
def _get_parser():
23
21
    serial = sub.add_parser('serial', help='Get serial for a device name')
24
22
    serial.set_defaults(func=_get_serial)
25
23
    serial.add_argument('name', help='Device name')
26
 
    power = sub.add_parser('power', help='Get power control info for a device')
27
 
    power.set_defaults(func=_get_power)
28
 
    power.add_argument('name', help='Device name')
29
24
    state = sub.add_parser('state', help='Get device state for a device')
30
25
    state.set_defaults(func=_get_state)
31
26
    state.add_argument('name', help='Device name')