#NEWLINE# def clone( self , image_location , dest_name , dest_pool = None ) : #NEWLINE# #INDENT# ( _fsid , pool , image , snapshot ) = self . parse_url ( image_location [ 'url' ] ) #NEWLINE# LOG . debug ( 'cloning %(pool)s/%(img)s@%(snap)s to %(dest_pool)s/%(dest_name)s' , dict ( pool = image , img = image , snap = snapshot , dest_pool = dest_pool , dest_name = dest_name ) ) #NEWLINE# with RADOSClient ( self , str ( pool ) ) as src_client : #NEWLINE# #INDENT# with RADOSClient ( self , dest_pool ) as dest_client : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# rbd . RBD ( ) . clone ( src_client . ioctx , image . encode ( 'utf-8' ) , snapshot . encode ( 'utf-8' ) , dest_client . ioctx , str ( dest_name ) , features = src_client . features ) #NEWLINE# #UNINDENT# except rbd . PermissionError : #NEWLINE# #INDENT# raise exception . Forbidden ( ( _ ( 'no write permission on storage pool %s' ) % dest_pool ) )