forked from FF-RGB/ansible
fix library/fastd_key for python 3.5
This commit is contained in:
parent
b47bd6bb3f
commit
7af1a441cf
@ -21,7 +21,7 @@ if __name__ == '__main__':
|
|||||||
# file does not exist or is empty?
|
# file does not exist or is empty?
|
||||||
if not os.path.isfile(path) or os.stat(path).st_size == 0:
|
if not os.path.isfile(path) or os.stat(path).st_size == 0:
|
||||||
# create file with restrictive permissions
|
# create file with restrictive permissions
|
||||||
with os.fdopen(os.open(path, os.O_WRONLY | os.O_CREAT, 0600), 'w') as handle:
|
with os.fdopen(os.open(path, os.O_WRONLY | os.O_CREAT, 0o600), 'w') as handle:
|
||||||
# generate fastd secret
|
# generate fastd secret
|
||||||
secret = subprocess.check_output(["fastd", "--machine-readable", "--generate-key"]).strip()
|
secret = subprocess.check_output(["fastd", "--machine-readable", "--generate-key"]).strip()
|
||||||
handle.write('secret "%s";\n' % secret)
|
handle.write('secret "%s";\n' % secret)
|
||||||
|
Loading…
Reference in New Issue
Block a user