[ivoks] Base 64 decode certificates prior to installation

Fixes issues with SSL usage using keystone signed certificates.
This commit is contained in:
James Page
2014-02-05 08:19:21 +02:00
3 changed files with 11 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
#!/usr/bin/python
from base64 import b64decode
from charmhelpers.core.hookenv import (
log, ERROR, WARNING,
config,
@@ -125,7 +127,8 @@ def db_amqp_changed():
def nm_changed():
CONFIGS.write_all()
if relation_get('ca_cert'):
install_ca_cert(relation_get('ca_cert'))
ca_crt = b64decode(relation_get('ca_cert'))
install_ca_cert(ca_crt)
@hooks.hook("cluster-relation-departed")

View File

@@ -1 +1 @@
59
60

View File

@@ -36,9 +36,14 @@ TO_PATCH = [
'execd_preinstall',
'lsb_release',
'stop_services',
'b64decode',
]
def passthrough(value):
return value
class TestQuantumHooks(CharmTestCase):
def setUp(self):
@@ -47,6 +52,7 @@ class TestQuantumHooks(CharmTestCase):
self.test_config.set('openstack-origin', 'cloud:precise-havana')
self.test_config.set('plugin', 'ovs')
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
self.b64decode.side_effect = passthrough
def _call_hook(self, hookname):
hooks.hooks.execute([