scripts / auth-keys-from-fas: run 2to3 and move to python3
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
79890867e1
commit
b7786f17ed
1 changed files with 8 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python -tt
|
#!/usr/bin/python3
|
||||||
#
|
#
|
||||||
# Copyright 2012 Red Hat, Inc.
|
# Copyright 2012 Red Hat, Inc.
|
||||||
# License: GPLv2+
|
# License: GPLv2+
|
||||||
|
@ -111,11 +111,11 @@ def read_config_files(cfg_files):
|
||||||
if results != True:
|
if results != True:
|
||||||
for (section_list, key, unused_) in flatten_errors(options, results):
|
for (section_list, key, unused_) in flatten_errors(options, results):
|
||||||
if key is not None:
|
if key is not None:
|
||||||
print 'The "%s" key in the section "%s" failed validation' % (
|
print('The "%s" key in the section "%s" failed validation' % (
|
||||||
key, ', '.join(section_list))
|
key, ', '.join(section_list)))
|
||||||
else:
|
else:
|
||||||
print 'The following section was missing:%s ' % ', '.join(
|
print('The following section was missing:%s ' % ', '.join(
|
||||||
section_list)
|
section_list))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
@ -159,8 +159,8 @@ def retry_fas(function, *args, **kwargs):
|
||||||
return function(*args, **kwargs)
|
return function(*args, **kwargs)
|
||||||
except AuthError:
|
except AuthError:
|
||||||
retries += 1
|
retries += 1
|
||||||
password = getpass('FAS Password for %s:' % function.im_self.username)
|
password = getpass('FAS Password for %s:' % function.__self__.username)
|
||||||
function.im_self.password = password
|
function.__self__.password = password
|
||||||
if retries >= MAX_RETRIES:
|
if retries >= MAX_RETRIES:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -203,4 +203,4 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
for user in sorted(ssh_keys.keys()):
|
for user in sorted(ssh_keys.keys()):
|
||||||
for key in ssh_keys[user]:
|
for key in ssh_keys[user]:
|
||||||
print '%s%s' % (from_string, key)
|
print('%s%s' % (from_string, key))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue