#NEWLINE# def get_deploy_info( node , **kwargs ) : #NEWLINE# #INDENT# 'Returns the information required for doing iSCSI deploy in a dictionary.\n\n    :param node: ironic node object\n    :param kwargs: the keyword args passed from the conductor node.\n    :raises: MissingParameterValue, if some required parameters were not\n        passed.\n    :raises: InvalidParameterValue, if any of the parameters have invalid\n        value.\n    ' #NEWLINE# deploy_key = kwargs . get ( 'key' ) #NEWLINE# i_info = deploy_utils . parse_instance_info ( node ) #NEWLINE# if ( i_info [ 'deploy_key' ] != deploy_key ) : #NEWLINE# #INDENT# raise exception . InvalidParameterValue ( _ ( 'Deploy key does not match' ) ) #NEWLINE# #UNINDENT# params = { #NEWLINE# #INDENT# 'address' : kwargs . get ( 'address' ) , #NEWLINE# 'port' : kwargs . get ( 'port' , '3260' ) , #NEWLINE# 'iqn' : kwargs . get ( 'iqn' ) , #NEWLINE# 'lun' : kwargs . get ( 'lun' , '1' ) , #NEWLINE# 'image_path' : _get_image_file_path ( node . uuid ) , #NEWLINE# 'node_uuid' : node . uuid , #NEWLINE# #UNINDENT# } #NEWLINE# is_whole_disk_image = node . driver_internal_info [ 'is_whole_disk_image' ] #NEWLINE# if ( not is_whole_disk_image ) : #NEWLINE# #INDENT# params . update ( { #NEWLINE# #INDENT# 'root_mb' : ( 1024 * int ( i_info [ 'root_gb' ] ) ) , #NEWLINE# 'swap_mb' : int ( i_info [ 'swap_mb' ] ) , #NEWLINE# 'ephemeral_mb' : ( 1024 * int ( i_info [ 'ephemeral_gb' ] ) ) , #NEWLINE# 'preserve_ephemeral' : i_info [ 'preserve_ephemeral' ] , #NEWLINE# 'boot_option' : deploy_utils . get_boot_option ( node ) , #NEWLINE# 'boot_mode' : _get_boot_mode ( node ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# disk_label = deploy_utils . get_disk_label ( node ) #NEWLINE# if ( disk_label is not None ) : #NEWLINE# #INDENT# params [ 'disk_label' ] = disk_label #NEWLINE# #UNINDENT# #UNINDENT# missing = [ key for key in params if ( params [ key ] is None ) ] #NEWLINE# if missing : #NEWLINE# #INDENT# raise exception . MissingParameterValue ( ( _ ( 'Parameters %s were not passed to ironic for deploy.' ) % missing ) ) #NEWLINE# #UNINDENT# if is_whole_disk_image : #NEWLINE# #INDENT# return params #NEWLINE# #UNINDENT# params [ 'ephemeral_format' ] = i_info . get ( 'ephemeral_format' ) #NEWLINE# params [ 'configdrive' ] = i_info . get ( 'configdrive' ) #NEWLINE# return missing