mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
E501 fixes (#22879)
This commit is contained in:
parent
4fdeade389
commit
3164e8b561
215 changed files with 1328 additions and 761 deletions
|
@ -122,7 +122,9 @@ def key_for_hostname(hostname):
|
|||
raise AnsibleError('ACCELERATE_KEYS_DIR is not a directory.')
|
||||
|
||||
if stat.S_IMODE(os.stat(key_path).st_mode) != int(C.ACCELERATE_KEYS_DIR_PERMS, 8):
|
||||
raise AnsibleError('Incorrect permissions on the private key directory. Use `chmod 0%o %s` to correct this issue, and make sure any of the keys files contained within that directory are set to 0%o' % (int(C.ACCELERATE_KEYS_DIR_PERMS, 8), C.ACCELERATE_KEYS_DIR, int(C.ACCELERATE_KEYS_FILE_PERMS, 8)))
|
||||
raise AnsibleError('Incorrect permissions on the private key directory. Use `chmod 0%o %s` to correct this issue, and make sure any of the keys files '
|
||||
'contained within that directory are set to 0%o' % (int(C.ACCELERATE_KEYS_DIR_PERMS, 8), C.ACCELERATE_KEYS_DIR,
|
||||
int(C.ACCELERATE_KEYS_FILE_PERMS, 8)))
|
||||
|
||||
key_path = os.path.join(key_path, hostname)
|
||||
|
||||
|
@ -143,7 +145,8 @@ def key_for_hostname(hostname):
|
|||
return key
|
||||
|
||||
if stat.S_IMODE(os.stat(key_path).st_mode) != int(C.ACCELERATE_KEYS_FILE_PERMS, 8):
|
||||
raise AnsibleError('Incorrect permissions on the key file for this host. Use `chmod 0%o %s` to correct this issue.' % (int(C.ACCELERATE_KEYS_FILE_PERMS, 8), key_path))
|
||||
raise AnsibleError('Incorrect permissions on the key file for this host. Use `chmod 0%o %s` to '
|
||||
'correct this issue.' % (int(C.ACCELERATE_KEYS_FILE_PERMS, 8), key_path))
|
||||
fh = open(key_path)
|
||||
key = AesKey.Read(fh.read())
|
||||
fh.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue