def get_tftp_image_info(instance, instance_type):
 image_info = {'kernel': [None, None], 'ramdisk': [None, None], 'deploy_kernel': [None, None], 'deploy_ramdisk': [None, None]}
 try:
  image_info['kernel'][0] = str(instance['kernel_id'])
  image_info['ramdisk'][0] = str(instance['ramdisk_id'])
  image_info['deploy_kernel'][0] = get_deploy_aki_id(instance_type)
  image_info['deploy_ramdisk'][0] = get_deploy_ari_id(instance_type)
 except KeyError as e:
  pass
 missing_labels = []
 for label in image_info.keys():
  (uuid, path) = image_info[label]
  if (not uuid):
   missing_labels.append(label)
  else:
   image_info[label][1] = os.path.join(CONF.baremetal.tftp_root, instance['uuid'], label)
 if missing_labels:
  raise exception.NovaException((_('Can not activate PXE bootloader. The following boot parameters were not passed to baremetal driver: %s') % missing_labels))
 return image_info

def get_tftp_image_info ( instance , instance_type ) : image_info = { 'kernel' : [ None , None ] , 'ramdisk' : [ None , None ] , 'deploy_kernel' : [ None , None ] , 'deploy_ramdisk' : [ None , None ] } try : image_info [ 'kernel' ] [ 0 ] = str ( instance [ 'kernel_id' ] ) image_info [ 'ramdisk' ] [ 0 ] = str ( instance [ 'ramdisk_id' ] ) image_info [ 'deploy_kernel' ] [ 0 ] = get_deploy_aki_id ( instance_type ) image_info [ 'deploy_ramdisk' ] [ 0 ] = get_deploy_ari_id ( instance_type ) except KeyError as e : pass missing_labels = [ ] for label in image_info . keys ( ) : ( uuid , path ) = image_info [ label ] if ( not uuid ) : missing_labels . append ( label ) else : image_info [ label ] [ 1 ] = os . path . join ( CONF . baremetal . tftp_root , instance [ 'uuid' ] , label ) if missing_labels : raise exception . NovaException ( ( _ ( 'Can not activate PXE bootloader. The following boot parameters were not passed to baremetal driver: %s' ) % missing_labels ) ) return image_info
generate the paths for tftp files for this instance raises novaexception if - instance does not contain kernel_id or ramdisk_id - deploy_kernel_id or deploy_ramdisk_id can not be read from instance_type[extra_specs] and defaults are not set .