def print_inventory(a_device):
 fields = ['device_name', 'ip_address', 'device_class', 'ssh_port', 'api_port', 'vendor', 'model', 'device_type', 'os_version', 'serial_number', 'uptime_seconds']
 print
 print ('#' * 80)
 for a_field in fields:
  value = getattr(a_device, a_field)
  print '{:>15s}: {:<65s}'.format(a_field, str(value))
 print ('#' * 80)
 print

def print_inventory ( a_device ) : fields = [ 'device_name' , 'ip_address' , 'device_class' , 'ssh_port' , 'api_port' , 'vendor' , 'model' , 'device_type' , 'os_version' , 'serial_number' , 'uptime_seconds' ] print print ( '#' * 80 ) for a_field in fields : value = getattr ( a_device , a_field ) print '{:>15s}: {:<65s}' . format ( a_field , str ( value ) ) print ( '#' * 80 ) print
print network device inventory information .