Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

Commit

Permalink
release detection is done via keystone package given that
Browse files Browse the repository at this point in the history
openstack-origin is not present in the subordinate charm
see juju/charm-helpers#83
  • Loading branch information
camille-rodriguez committed Feb 25, 2020
1 parent 1090de2 commit 2ec095d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/lib/charm/openstack/keystone_kerberos.py
Expand Up @@ -8,14 +8,38 @@

import charms_openstack.charm
import charms_openstack.adapters
# release detection is done via keystone package given that
# openstack-origin is not present in the subordinate charm
# see https://github.com/juju/charm-helpers/issues/83
import charmhelpers.core.unitdata as unitdata
from charms_openstack.charm.core import (
register_os_release_selector
)

import os
import shutil


APACHE_CONF_TEMPLATE = "apache-kerberos.conf"
KERBEROS_CONF_TEMPLATE = "krb5.conf"
KEYTAB_PATH = "/etc/keystone.keytab"


@register_os_release_selector
def select_release():
"""Determine the release based on the keystone package version.
Note that this function caches the release after the first install so
that it doesn't need to keep going and getting it from the package
information.
"""
release_version = unitdata.kv().get(OPENSTACK_RELEASE_KEY, None)
if release_version is None:
release_version = os_utils.os_release('keystone')
unitdata.kv().set(OPENSTACK_RELEASE_KEY, release_version)
return release_version


class KeystoneKerberosCharm(
charms_openstack.charm.OpenStackCharm):

Expand Down Expand Up @@ -51,6 +75,7 @@ def kerberos_realm(self):
"""
return hookenv.config('kerberos-realm')

@property
def kerberos_server(self):
"""Server name for the running application
Expand Down
4 changes: 2 additions & 2 deletions src/reactive/keystone_kerberos_handlers.py
Expand Up @@ -39,8 +39,8 @@ def keystone_departed():
@reactive.when('keystone-fid-service-provider.connected')
def publish_sp_fid(fid_sp):
with charm.provide_charm_instance() as charm_instance:
fid_sp.publish(charm_instance.options.kerberos-realm,
charm_instance.options.kerberos-server)
fid_sp.publish(charm_instance.kerberos-realm,
charm_instance.kerberos-server)


@reactive.when('keystone-fid-service-provider.available')
Expand Down

0 comments on commit 2ec095d

Please sign in to comment.