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