@@ -535,9 +535,14 @@ def execute_commands(self, command_list, connector):
535535 # do nothing if we have no commands for this connector
536536 if not command_list :
537537 return
538+
539+ # Instead of a Commands object, some items in the list might be None
540+ # this can happen if country code is invalid, for instance
541+ command_list = [c for c in command_list if c is not None ]
538542
539543 total_users = len (command_list )
540544
545+ # split off the last command if we have more than 10, so we can send the signals
541546 if len (command_list ) > 10 :
542547 command_list , last_command = command_list [0 :- 1 ], command_list [- 1 ]
543548 connector .start_sync ()
@@ -642,7 +647,7 @@ def process_strays(self, primary_commands, secondary_command_lists, umapi_connec
642647 self .logger .critical ('Unable to process Adobe-only users, as their count (%s) is larger '
643648 'than the max_adobe_only_users setting (%s)' , stray_count , max_missing_option )
644649 self .action_summary ['primary_strays_processed' ] = 0
645- return
650+ return [], {}
646651 self .logger .debug ("Processing Adobe-only users..." )
647652 return self .manage_strays (primary_commands , secondary_command_lists , umapi_connectors )
648653
@@ -676,7 +681,7 @@ def get_commands(key):
676681 return user_sync .connector .umapi .Commands (identity_type = id_type , username = username , domain = domain )
677682
678683 # do the secondary umapis first, in case we are deleting user accounts from the primary umapi at the end
679- for umapi_name , umapi_connector in umapi_connectors .get_secondary_connectors (). items ():
684+ for umapi_name in umapi_connectors .get_secondary_connectors ():
680685 secondary_strays = self .get_stray_keys (umapi_name )
681686 for user_key in primary_strays :
682687 if user_key in secondary_strays :
@@ -708,7 +713,6 @@ def get_commands(key):
708713 continue
709714
710715 # finish with the primary umapi
711- primary_connector = umapi_connectors .get_primary_connector ()
712716 for user_key in primary_strays :
713717 commands = get_commands (user_key )
714718 if disentitle_strays :
0 commit comments