#NEWLINE# def prepare( self , task ) : #NEWLINE# #INDENT# "Prepare the deployment environment for this task's node.\n\n        Generates the TFTP configuration for PXE-booting both the deployment\n        and user images, fetches the TFTP image from Glance and add it to the\n        local cache.\n\n        :param task: a TaskManager instance containing the node to act on.\n        " #NEWLINE# node = task . node #NEWLINE# if ( node . provision_state == states . ACTIVE ) : #NEWLINE# #INDENT# task . driver . boot . prepare_instance ( task ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# deploy_opts = build_deploy_ramdisk_options ( node ) #NEWLINE# agent_opts = deploy_utils . build_agent_options ( node ) #NEWLINE# deploy_opts . update ( agent_opts ) #NEWLINE# task . driver . boot . prepare_ramdisk ( task , agent_opts )