Commit ec4bdad8 authored by Jérome Perrin's avatar Jérome Perrin Committed by Rafael Monnerat

recipe.dropbear.AuthorizedKeysFile: Fix returned paths

This recipe only created ~/.ssh/authorized_keys, so it should not return
the full ~/.ssh/ directory because uninstallation will delete "too
much".

@alain.takoudjou @rafael after machine was restarted yesterday, the keys I added in ~/.ssh/ of my webrunner were not here anymore. I think this is the reason, thanks for taking a look when you have time.

/reviewed-on !37
parent f4e51f77
......@@ -182,15 +182,12 @@ def keysplit(s):
class AddAuthorizedKey(GenericBaseRecipe):
def install(self):
path_list = []
ssh = self.createDirectory(self.options['home'], '.ssh')
path_list.append(ssh)
authorized_keys = AuthorizedKeysFile(os.path.join(ssh, 'authorized_keys'))
for key in keysplit(self.options['key']):
# XXX key might actually be the string 'None' or 'null'
authorized_keys.append(key)
return path_list
return [authorized_keys.filename]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment