Skip to content
Snippets Groups Projects
Commit ccd040c8 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed line returns in SSH auth keys.

parent 9853b7cc
No related branches found
No related tags found
No related merge requests found
...@@ -13,13 +13,13 @@ def add_allowed_keys(path, keys): ...@@ -13,13 +13,13 @@ def add_allowed_keys(path, keys):
content = fo.read() content = fo.read()
elif not os.path.exists(os.path.dirname(path)): elif not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path)) os.makedirs(os.path.dirname(path))
new_content = content.strip() new_content = content.strip() + '\n'
for key in keys: for key in keys:
key = key.strip() key = key.strip()
if not key: if not key:
continue continue
if key not in new_content: if key not in new_content:
new_content += '\n' + key new_content += key + '\n'
utils.log('The key "%s" will be added in "%s".' % (key.split(' ')[-1], path)) utils.log('The key "%s" will be added in "%s".' % (key.split(' ')[-1], path))
else: else:
utils.log('The key "%s" is already in "%s".' % (key.split(' ')[-1], path)) utils.log('The key "%s" is already in "%s".' % (key.split(' ')[-1], path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment