Ubuntu Pastebin

Paste from marco at Mon, 5 Dec 2016 18:39:26 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
    # Use the metadata charm helper to load the metadata.yaml for datadog
    # charm dynamically and parse requires relations
    integrations = metadata().get('requires').keys()

    # Loop over all the integrations defined in the charms metadata and
    # check if they're available (ready to be configured)
    for integration in integrations:
        if is_state('{}.available'.format(integration)):
            # Load up the interfaces from reactive, extract the goodies
            # and write out configuration files
            rel_data = RelationBase.from_state(integration)
            config_keys = rel_data.auto_accessors
            configuration = {k: rel_data.k() for k in config_keys}
Download as text