Merge lp:~cprov/charms/trusty/logstash/ls-custom-config into lp:~tanuki/charms/trusty/logstash/trunk

Proposed by Celso Providelo
Status: Merged
Merged at revision: 50
Proposed branch: lp:~cprov/charms/trusty/logstash/ls-custom-config
Merge into: lp:~tanuki/charms/trusty/logstash/trunk
Diff against target: 28 lines (+10/-0)
2 files modified
config.yaml (+4/-0)
hooks/config-changed (+6/-0)
To merge this branch: bzr merge lp:~cprov/charms/trusty/logstash/ls-custom-config
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+267990@code.launchpad.net

Commit message

Support 'extra-config' configuration option. Good for configuring PD output or other bits that depend on private/local information (API key).

Description of the change

Support 'extra-config' configuration option. Good for configuring PD output or other bits that depend on private/local information (API key).

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2015-03-31 09:37:21 +0000
+++ config.yaml 2015-08-13 19:47:36 +0000
@@ -19,3 +19,7 @@
19 default: ""19 default: ""
20 type: string20 type: string
21 description: "Base64-encoded SSL key"21 description: "Base64-encoded SSL key"
22 extra-config:
23 type: string
24 default: ''
25 description: "Base64-encoded custom configuration content."
2226
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2015-08-04 14:10:31 +0000
+++ hooks/config-changed 2015-08-13 19:47:36 +0000
@@ -60,6 +60,12 @@
60 p.write(render(os.path.basename(f), opts))60 p.write(render(os.path.basename(f), opts))
6161
62 config_data = hookenv.config()62 config_data = hookenv.config()
63
64 # Write custom configuration if set.
65 if config_data['extra_config']:
66 with open(os.path.join(BASEPATH, 'conf.d', 'extra.conf'), 'w') as f:
67 f.write(str(base64.b64decode(config_data['extra_config'])))
68
63 # Only setup lumberjack protocol if ssl cert and key are configured69 # Only setup lumberjack protocol if ssl cert and key are configured
64 if config_data['ssl_cert'] and config_data['ssl_key']:70 if config_data['ssl_cert'] and config_data['ssl_key']:
65 if not os.path.exists(cert_dir):71 if not os.path.exists(cert_dir):

Subscribers

People subscribed via source and target branches

to all changes: