~joeborg/charms/trusty/contrail-configuration/rbac-switch

« back to all changes in this revision

Viewing changes to hooks/contrail_configuration_hooks.py

  • Committer: Robert Ayres
  • Date: 2017-03-10 12:49:07 UTC
  • mfrom: (63.1.1 contrail-configuration)
  • Revision ID: robert.ayres@canonical.com-20170310124907-w325mry8jegcg418
Merge Ante Karamatic's changes (with modifications)

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    fix_services,
55
55
    provision_configuration,
56
56
    provision_metadata,
 
57
    remove_ssl_ca_certificate,
57
58
    units,
58
59
    unprovision_configuration,
59
60
    unprovision_metadata,
66
67
    write_discovery_config,
67
68
    write_ifmap_config,
68
69
    write_nodemgr_config,
 
70
    write_ssl_ca_certificate,
69
71
    write_vnc_api_config
70
72
)
71
73
 
186
188
@hooks.hook("config-changed")
187
189
def config_changed():
188
190
    write_config()
 
191
    configure_ssl()
189
192
 
190
193
    if config.get("contrail-api-configured"):
191
194
        wait_for_contrail_api()
256
259
 
257
260
            leader_set({"floating-ip-pools": floating_pools})
258
261
 
 
262
def configure_ssl():
 
263
    cert = config.get("ssl-ca")
 
264
    if cert:
 
265
        if write_ssl_ca_certificate(cert):
 
266
            service_restart("supervisor-config")
 
267
    else:
 
268
        if remove_ssl_ca_certificate():
 
269
            service_restart("supervisor-config")
 
270
 
259
271
@hooks.hook("contrail-analytics-api-relation-changed")
260
272
def contrail_analytics_api_changed():
261
273
    if not relation_get("port"):