#NEWLINE# def _skip_existing_volumes( self ) : #NEWLINE# #INDENT# LOG . info ( 'Start compare existing volumes on the destination cloud. If volumes exist on the destination cloud, then skip migration for those volumes.' ) #NEWLINE# res = [ ] #NEWLINE# dst_ids = [ v [ 'id' ] for v in self . data [ DST ] [ 'volumes' ] ] #NEWLINE# for v in self . data [ SRC ] [ 'volumes' ] : #NEWLINE# #INDENT# if ( v [ 'id' ] in dst_ids ) : #NEWLINE# #INDENT# LOG . warning ( 'Volume %s(%s) exists, skipping migration.' , v . get ( 'display_name' , '' ) , v [ 'id' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# res . append ( v ) #NEWLINE# LOG . info ( 'Volume %s(%s) does not exist on the destination cloud, will be migrated.' , v . get ( 'display_name' , '' ) , v [ 'id' ] ) #NEWLINE# #UNINDENT# #UNINDENT# self . data [ SRC ] [ 'volumes' ] = res #NEWLINE# LOG . info ( 'All volumes on the source and destination cloud have been compared.' )