Commit eb59577a authored by Joanne Hugé's avatar Joanne Hugé

cookbook: Fix how slave instance parameters are passed in re6stnet

parent ab1eb698
......@@ -49,9 +49,8 @@ class Recipe(GenericBaseRecipe):
self.software_release_url = slap_connection['software-release-url']
self.key_file = slap_connection.get('key-file')
self.cert_file = slap_connection.get('cert-file')
self.slave_list = json.loads(options['slave-instance-list'])
self.slave_list = options['slave-instance-list']
options['slave-amount'] = '%s' % len(self.slave_list)
return GenericBaseRecipe.__init__(self, buildout, name, options)
def getSerialFromIpv6(self, ipv6):
......
......@@ -38,7 +38,7 @@ class Re6stnetTest(unittest.TestCase):
'drop-service-wrapper': os.path.join(self.base_dir, 'drop_wrapper'),
'check-service-wrapper': os.path.join(self.base_dir, 'check_wrapper'),
'revoke-service-wrapper': os.path.join(self.base_dir, 'revoke_wrapper'),
'slave-instance-list': '{}'
'slave-instance-list': [],
}
def tearDown(self):
......@@ -119,11 +119,10 @@ class Re6stnetTest(unittest.TestCase):
def test_install(self):
self.options.update({
'ipv6-prefix': '2001:db8:24::/48',
'slave-instance-list': '''[
'slave-instance-list': [
{"slave_reference":"SOFTINST-58770"},
{"slave_reference":"SOFTINST-58778"}
]
'''
})
recipe = self.new_recipe()
......@@ -161,7 +160,7 @@ class Re6stnetTest(unittest.TestCase):
# Remove one element
self.options.update({
"slave-instance-list": """[{"slave_reference":"SOFTINST-58770"}]"""
"slave-instance-list": [{"slave_reference":"SOFTINST-58770"}]
})
recipe = self.new_recipe()
recipe.generateCertificate = self.fake_generateCertificates
......
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