示例#1
0
         if arg:
             try:
                 hw_info.set_mac_addr(which, arg)
             except:
                 print 'Error setting mac address'
         return -1
     
     if opt in ('-a', '--about'):
         about = 'Model number: %s\n' % hw_info.model()
         about += 'Product ID: %s\n' % hw_info.get_pid()
         about += 'Framework version: %s\n' % properties.COMPOUND_VERSION
         about += 'MOE version: %s\n' % properties.MOE_VERSION
         about += 'Manufacturing serial number: %s\n' % hw_info.serialno()
         about += 'Distribution serial number: %s\n' % hw_info.serialno_df()
         about += 'Cisco serial number: %s\n' % hw_info.serialno_cisco()
         about += 'Assembly number: %s\n' % hw_info.get_assembly()
         about += 'eth0 MAC address: %s\n' % hw_info.mac_addr(0)
         if hw_info.model() in ('TSWS', '2400', '2500'):
             about += 'eth1 MAC address: %s\n' % hw_info.mac_addr(1)
         message(about)
         return 1
     
 verbose_printing = not bool(attrs)
 if verbose_printing:
     message('Initializing the test framework, this will take up to two minutes...')
 try:
     fd = open('/dev/avr')
     fd.close()
 except:
     message('Error - the framework must be stopped before running tests')
     return -1