Commit b4914c09 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

recipe/pbs: slave-instance-list is already a list of JSON

See nexedi/slapos!739
parent 5afb8605
......@@ -57,7 +57,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
def _options(self, options):
options['rdiff-backup-data-folder'] = ""
if 'slave-instance-list' in options:
for slave in json.loads(options['slave-instance-list']):
for slave in options['slave-instance-list']:
if slave['type'] == 'pull':
options['rdiff-backup-data-folder'] = str(os.path.join(options['directory'], slave['name'], 'rdiff-backup-data'))
......@@ -299,8 +299,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
if self.optionIsTrue('client', True):
self.logger.info("Client mode")
slaves = json.loads(self.options['slave-instance-list'])
slaves = self.options['slave-instance-list']
known_hosts = KnownHostsFile(self.options['known-hosts'])
with known_hosts:
for slave in slaves:
......
......@@ -82,7 +82,7 @@ class PBSTest(unittest.TestCase):
'run-directory': run_directory,
'cron-entries': cron_directory,
'known-hosts': 'TEST_KNOWN_HOSTS',
'slave-instance-list': '''[
'slave-instance-list': [
{
"url": "http://url.to.pull/",
"type": "pull",
......@@ -101,7 +101,6 @@ class PBSTest(unittest.TestCase):
"frequency": "TEST_FREQUENCY"
}
]
'''
})
recipe._install()
......
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