#NEWLINE# def _WaitForDiskReady( self , disk_name ) : #NEWLINE# #INDENT# "Waits for the persistent disk get ready.\n\n    Args:\n      disk_name: Name of the persistent disk.\n    Raises:\n      ClusterSetUpError: persistent disk didn't get ready until timeout.\n    " #NEWLINE# for _ in xrange ( _ . DISK_CREATION_MAX_WAIT_TIMES ) : #NEWLINE# #INDENT# logging . info ( 'Waiting for boot disk %s getting ready...' , disk_name ) #NEWLINE# disk_status = self . _GetApi ( ) . GetDisk ( disk_name ) #NEWLINE# if ( disk_status and ( disk_status . get ( 'status' , None ) == 'READY' ) ) : #NEWLINE# #INDENT# logging . info ( 'Disk %s created successfully.' , disk_name ) #NEWLINE# break #NEWLINE# #UNINDENT# time . sleep ( self . DISK_CREATION_WAIT_INTERVAL ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ClusterSetUpError ( ( 'Persistent disk %s creation timed out.' % disk_name ) )