#NEWLINE# def allowed( self , request , volume = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# limits = api . cinder . tenant_absolute_limits ( request ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# exceptions . handle ( request , _ ( 'Unable to retrieve tenant limits.' ) ) #NEWLINE# limits = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# snapshots_available = ( limits . get ( 'maxTotalSnapshots' , float ( 'inf' ) ) - limits . get ( 'totalSnapshotsUsed' , 0 ) ) #NEWLINE# if ( ( snapshots_available <= 0 ) and ( 'disabled' not in self . classes ) ) : #NEWLINE# #INDENT# self . classes = ( [ c for c in self . classes ] + [ 'disabled' ] ) #NEWLINE# self . verbose_name = string_concat ( self . verbose_name , ' ' , _ ( '(Quota exceeded)' ) ) #NEWLINE# #UNINDENT# return ( volume . status in ( 'available' , 'in-use' ) )