From 491ee01d3501357bf877ee8a1acbc2b82a18f5c5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 9 Jun 2020 23:17:29 +0200 Subject: [PATCH] First pass at porting scripts/users-from-fas to python3 Signed-off-by: Pierre-Yves Chibon --- scripts/users-from-fas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/users-from-fas b/scripts/users-from-fas index 9d1b309374..55683b9ba5 100755 --- a/scripts/users-from-fas +++ b/scripts/users-from-fas @@ -112,11 +112,11 @@ def read_config_files(cfg_files): if results != True: for (section_list, key, unused_) in flatten_errors(options, results): if key is not None: - print 'The "%s" key in the section "%s" failed validation' % ( - key, ', '.join(section_list)) + print('The "%s" key in the section "%s" failed validation' % ( + key, ', '.join(section_list))) else: - print 'The following section was missing:%s ' % ', '.join( - section_list) + print('The following section was missing:%s ' % ', '.join( + section_list)) sys.exit(1) return options @@ -153,8 +153,8 @@ def retry_fas(function, *args, **kwargs): return function(*args, **kwargs) except AuthError: retries += 1 - password = getpass('FAS Password for %s:' % function.im_self.username) - function.im_self.password = password + password = getpass('FAS Password for %s:' % function.__self__.username) + function.__self__.password = password if retries >= MAX_RETRIES: raise @@ -190,4 +190,4 @@ if __name__ == '__main__': conf['users'].update(members_of_group(group, use_fas=conf['fas_groups'])) for user in sorted(set(conf['users'])): - print user + print(user)