def default_device_names_for_instance(instance, root_device_name, *block_device_lists):
 dev_list = [bdm.device_name for bdm in itertools.chain(*block_device_lists) if bdm.device_name]
 if (root_device_name not in dev_list):
  dev_list.append(root_device_name)
 for bdm in itertools.chain(*block_device_lists):
  dev = bdm.device_name
  if (not dev):
   dev = get_next_device_name(instance, dev_list, root_device_name)
   bdm.device_name = dev
   bdm.save()
   dev_list.append(dev)

def default_device_names_for_instance ( instance , root_device_name , * block_device_lists ) : dev_list = [ bdm . device_name for bdm in itertools . chain ( * block_device_lists ) if bdm . device_name ] if ( root_device_name not in dev_list ) : dev_list . append ( root_device_name ) for bdm in itertools . chain ( * block_device_lists ) : dev = bdm . device_name if ( not dev ) : dev = get_next_device_name ( instance , dev_list , root_device_name ) bdm . device_name = dev bdm . save ( ) dev_list . append ( dev )
generate missing device names for an instance .