Commit 79b03abc authored by Antoine Catton's avatar Antoine Catton

Finalize duplicity recipe in order to have push and pull

parent a88bf182
...@@ -30,15 +30,23 @@ class Recipe(GenericBaseRecipe): ...@@ -30,15 +30,23 @@ class Recipe(GenericBaseRecipe):
def install(self): def install(self):
remote_url = self.options['remote_backup'] remote_url = self.options['remote-backup']
backup_directory = self.options['directory'] backup_directory = self.options['local-directory']
wrapper = self.createPythonScript( cmd = [self.options['duplicity-binary'],]
self.options['wrapper'], options = ['--no-encryption']
'slapos.recipe.librecipe.execute.execute',
[self.options['duplicity_binary'], '--no-encryption', if self.optionIsTrue('recover', False):
backup_directory, remote_url] # duplicity restore [options] remote backup
) cmd.append('restore')
return [wrapper] cmd.extend(options)
cmd.extend([remote_url, backup_directory])
else:
# duplicity [options] local remote
cmd.extend(options)
cmd.extend([backup_directory, remote_url])
wrapper = self.createPythonScript(self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute', cmd)
return [wrapper]
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