Commit baeecc98 authored by Jérome Perrin's avatar Jérome Perrin

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".
parent d88878e6
......@@ -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