#NEWLINE# def _check_glance_upload( ) : #NEWLINE# #INDENT# glance = utils . Glance ( ) #NEWLINE# glance . add_argument ( '--monitoring-image' , dest = 'image_name' , type = str , default = 'openstack-monitoring-test-image' , help = 'Name of the monitoring image' ) #NEWLINE# ( options , args , client ) = glance . setup ( ) #NEWLINE# data_raw = ( ( 'X' * 1024 ) * 1024 ) #NEWLINE# ( elapsed , res ) = utils . timeit ( client . images . create , data = data_raw , disk_format = 'raw' , container_format = 'bare' , name = options . image_name ) #NEWLINE# if ( ( not res ) or ( not args . id ) or ( res . status != 'active' ) ) : #NEWLINE# #INDENT# utils . critical ( 'Unable to upload image in Glance' ) #NEWLINE# #UNINDENT# res . delete ( ) #NEWLINE# if ( elapsed > 20 ) : #NEWLINE# #INDENT# utils . warning ( "Upload image in 20 seconds, it's too long" ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# utils . ok ( ( 'Glance image uploaded in %s seconds' % elapsed ) )