[ivoks] Base 64 decode certificates prior to installation
Fixes issues with SSL usage using keystone signed certificates.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from base64 import b64decode
|
||||||
|
|
||||||
from charmhelpers.core.hookenv import (
|
from charmhelpers.core.hookenv import (
|
||||||
log, ERROR, WARNING,
|
log, ERROR, WARNING,
|
||||||
config,
|
config,
|
||||||
@@ -125,7 +127,8 @@ def db_amqp_changed():
|
|||||||
def nm_changed():
|
def nm_changed():
|
||||||
CONFIGS.write_all()
|
CONFIGS.write_all()
|
||||||
if relation_get('ca_cert'):
|
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")
|
@hooks.hook("cluster-relation-departed")
|
||||||
|
|||||||
@@ -36,9 +36,14 @@ TO_PATCH = [
|
|||||||
'execd_preinstall',
|
'execd_preinstall',
|
||||||
'lsb_release',
|
'lsb_release',
|
||||||
'stop_services',
|
'stop_services',
|
||||||
|
'b64decode',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def passthrough(value):
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
class TestQuantumHooks(CharmTestCase):
|
class TestQuantumHooks(CharmTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@@ -47,6 +52,7 @@ class TestQuantumHooks(CharmTestCase):
|
|||||||
self.test_config.set('openstack-origin', 'cloud:precise-havana')
|
self.test_config.set('openstack-origin', 'cloud:precise-havana')
|
||||||
self.test_config.set('plugin', 'ovs')
|
self.test_config.set('plugin', 'ovs')
|
||||||
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
|
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
|
||||||
|
self.b64decode.side_effect = passthrough
|
||||||
|
|
||||||
def _call_hook(self, hookname):
|
def _call_hook(self, hookname):
|
||||||
hooks.hooks.execute([
|
hooks.hooks.execute([
|
||||||
|
|||||||
Reference in New Issue
Block a user