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