#NEWLINE# def is_cloneable( self , image_location , image_meta ) : #NEWLINE# #INDENT# url = image_location [ 'url' ] #NEWLINE# try : #NEWLINE# #INDENT# ( fsid , pool , image , snapshot ) = self . parse_url ( url ) #NEWLINE# #UNINDENT# except exception . ImageUnacceptable as e : #NEWLINE# #INDENT# LOG . debug ( 'not cloneable: %s' , e ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( self . get_fsid ( ) != fsid ) : #NEWLINE# #INDENT# reason = ( '%s is in a different ceph cluster' % url ) #NEWLINE# LOG . debug ( reason ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( image_meta . get ( 'disk_format' ) != 'raw' ) : #NEWLINE# #INDENT# reason = "rbd image clone requires image format to be 'raw' but image {0} is '{1}'" . format ( url , image_meta . get ( 'disk_format' ) ) #NEWLINE# LOG . debug ( reason ) #NEWLINE# return False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return self . exists ( image , pool = pool , snapshot = snapshot ) #NEWLINE# #UNINDENT# except rbd . Error as e : #NEWLINE# #INDENT# LOG . debug ( ( 'Unable to open image %(loc)s: %(err)s' % dict ( loc = url , err = e ) ) ) #NEWLINE# return False