예제 #1
0
def print_all_disks(disks=None):
    ''' Print debugging information for all tgt disks
        
        Args: 
            disks: A list of tgt disk objects. If not specified,
                   run tgt.discover_target_data() and print out
                   all found disks

    '''

    if disks is None:
        disks = tgt.discover_target_data()
    for disk in disks:
        print str(disk)
예제 #2
0
 def get_disks(disks, pools):
     '''
     Call into target discovery and get disk data. The disks found are
     added to the list passed in by the 'disks' argument
     
     '''
     try:
         td_disks = tgt.discover_target_data()
         for disk in td_disks:
             disks.append(DiskInfo(tgt_disk=disk))
         pools.extend(get_zpool_list())
     # If an exception occurs, regardless of type, log it, add it as the
     # first item in the disk list, and consume it (an uncaught Exception
     # in this threaded code would distort the display).
     # During the call to _show, if an exception occurred, the program
     # aborts gracefully
     # pylint: disable-msg=W0703
     except BaseException, err:
         logging.exception(traceback.format_exc())
         disks.insert(0, err)
예제 #3
0
 def get_disks(disks, pools):
     '''
     Call into target discovery and get disk data. The disks found are
     added to the list passed in by the 'disks' argument
     
     '''
     try:
         td_disks = tgt.discover_target_data()
         for disk in td_disks:
             disks.append(DiskInfo(tgt_disk=disk))
         pools.extend(get_zpool_list())
     # If an exception occurs, regardless of type, log it, add it as the
     # first item in the disk list, and consume it (an uncaught Exception
     # in this threaded code would distort the display).
     # During the call to _show, if an exception occurred, the program
     # aborts gracefully
     # pylint: disable-msg=W0703
     except BaseException, err:
         logging.exception(traceback.format_exc())
         disks.insert(0, err)