#NEWLINE# def run( self , **kwargs ) : #NEWLINE# #INDENT# if self . cfg . migrate . migrate_users : #NEWLINE# #INDENT# LOG . info ( 'Users will be migrated. Skipping this check.' ) #NEWLINE# return #NEWLINE# #UNINDENT# src_identity = self . src_cloud . resources [ utils . IDENTITY_RESOURCE ] #NEWLINE# dst_identity = self . dst_cloud . resources [ utils . IDENTITY_RESOURCE ] #NEWLINE# src_keystone_client = src_identity . get_client ( ) #NEWLINE# dst_keystone_client = dst_identity . get_client ( ) #NEWLINE# LOG . info ( 'Going to get all users from source cloud, this may take a while for large LDAP-backed clouds, please be patient' ) #NEWLINE# src_users = src_keystone_client . users . list ( ) #NEWLINE# dst_users = dst_keystone_client . users . list ( ) #NEWLINE# src_user_names = { usr . name . lower ( ) : usr . name for usr in src_users } #NEWLINE# dst_user_names = { usr . name . lower ( ) : usr . name for usr in dst_users } #NEWLINE# users_missing_on_dst = ( set ( src_user_names . keys ( ) ) - set ( dst_user_names . keys ( ) ) ) #NEWLINE# if users_missing_on_dst : #NEWLINE# #INDENT# msg = '{n} missing users on destination: {users}' . format ( n = len ( users_missing_on_dst ) , users = ', ' . join ( ( src_user_names [ key ] for key in users_missing_on_dst ) ) ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise cf_exceptions . AbortMigrationError ( msg ) #NEWLINE# #UNINDENT# LOG . info ( 'All users are available on source, migration can proceed' )