#NEWLINE# def _check_vdi( self , vdi_ref , check_attached = True ) : #NEWLINE# #INDENT# vdi_rec = self . session . call_xenapi ( 'VDI.get_record' , vdi_ref ) #NEWLINE# self . assertEqual ( str ( ( 10 * units . Mi ) ) , vdi_rec [ 'virtual_size' ] ) #NEWLINE# if check_attached : #NEWLINE# #INDENT# vbd_ref = vdi_rec [ 'VBDs' ] [ 0 ] #NEWLINE# vbd_rec = self . session . call_xenapi ( 'VBD.get_record' , vbd_ref ) #NEWLINE# self . assertEqual ( self . vm_ref , vbd_rec [ 'VM' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( 0 , len ( vdi_rec [ 'VBDs' ] ) )