@@ -173,8 +173,10 @@ def load_invocation_options(self):
173
173
174
174
# --users and --adobe-only-user-list conflict with each other, so we need to disambiguate.
175
175
# Argument specifications override configuration options, so you must have one or the other
176
- # either as an argument or as a configured default.
177
- if self .args ['users' ] and self .args ['adobe_only_user_list' ]:
176
+ # either as an argument or as a configured default. For a complete check, we need to compare against
177
+ # BOTH the args values AND the options values (in order to catch the invocation defaults).
178
+ if (self .args ['users' ] or (options ['users' ] and options ['users' ] != self .invocation_defaults ['users' ])) \
179
+ and (self .args ['adobe_only_user_list' ] or options ['adobe_only_user_list' ]):
178
180
# specifying both --users and --adobe-only-user-list is an error
179
181
raise AssertionException ('You cannot specify both a --users arg and an --adobe-only-user-list arg' )
180
182
elif self .args ['users' ]:
@@ -188,20 +190,12 @@ def load_invocation_options(self):
188
190
raise AssertionException ('You cannot specify --adobe-only-user-list when using "push" strategy' )
189
191
users_spec = None
190
192
stray_list_input_path = self .args ['adobe_only_user_list' ]
191
-
192
- # Check both that options['users'] exists, AND that it is not the default value before checking against
193
- # the adobe_only_user_list parameter - otherwise, defaults cause exception to be thrown unconditionally when
194
- # the user list option is specified
195
- elif (options ['users' ] and options ['users' ] != self .invocation_defaults ['users' ]) and options ['adobe_only_user_list' ]:
196
- raise AssertionException ('You cannot configure both a default "users" option (%s) '
197
- 'and a default "adobe-only-user-list" option (%s)' %
198
- (' ' .join (options ['users' ]), options ['adobe_only_user_list' ]))
199
- elif options ['users' ]:
200
- users_spec = options ['users' ]
201
- stray_list_input_path = None
202
193
elif options ['adobe_only_user_list' ]:
203
194
users_spec = None
204
195
stray_list_input_path = options ['adobe_only_user_list' ]
196
+ elif options ['users' ]:
197
+ users_spec = options ['users' ]
198
+ stray_list_input_path = None
205
199
else :
206
200
raise AssertionException ('You must specify either a "users" option or an "adobe-only-user-list" option.' )
207
201
@@ -301,7 +295,7 @@ def get_directory_connector_module_name(self):
301
295
"""
302
296
:rtype str
303
297
"""
304
- if self .invocation_options [ 'stray_list_input_path' ] :
298
+ if self .invocation_options . get ( 'stray_list_input_path' , None ) :
305
299
return None
306
300
connector_type = self .invocation_options .get ('directory_connector_type' )
307
301
if connector_type :
0 commit comments