Merge ~barryprice/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master into ~wordpress-charmers/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master

Proposed by Barry Price
Status: Merged
Approved by: Barry Price
Approved revision: 24bf3a62462d36bb52fcfcf3a9b33b45e9685adb
Merged at revision: baf77967b42ecd7a846463cb7405c12cc860a18d
Proposed branch: ~barryprice/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master
Merge into: ~wordpress-charmers/charm-k8s-wordpress/+git/wordpress-k8s-image-builder:master
Diff against target: 37 lines (+22/-0)
1 file modified
files/plugin_handler.py (+22/-0)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+383235@code.launchpad.net

Commit message

Basic swift config for openstack-objectstorage plugin, no input validation yet

To post a comment you must log in.
Revision history for this message
Barry Price (barryprice) wrote :
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM, although I don't think the comment is so useful

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision baf77967b42ecd7a846463cb7405c12cc860a18d

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/plugin_handler.py b/files/plugin_handler.py
2index 4feb8f2..5c698af 100644
3--- a/files/plugin_handler.py
4+++ b/files/plugin_handler.py
5@@ -83,6 +83,12 @@ def enable_openid(team_map):
6 add_option("openid_teams_trust_list", encoded_team_map)
7
8
9+def enable_swift(swift_config):
10+ enable_plugin("openstack-objectstorage/objectstorage.php")
11+ for k, v in swift_config.items():
12+ add_option("object_storage_{}".format(k), v)
13+
14+
15 def configure_wordpress():
16 url = "http://localhost"
17 sleep_time = 10
18@@ -128,3 +134,19 @@ if __name__ == "__main__":
19 team_map = os.getenv("WP_PLUGIN_OPENID_TEAM_MAP")
20 if team_map:
21 enable_openid(team_map)
22+
23+ swift_url = os.getenv("SWIFT_URL")
24+ if swift_url:
25+ swift_config = {}
26+ swift_config['url'] = swift_url
27+ swift_config['auth_url' = os.getenv("SWIFT_AUTH_URL")
28+ swift_config['bucket'] = os.getenv("SWIFT_BUCKET")
29+ swift_config['password'] = os.getenv("SWIFT_PASSWORD")
30+ swift_config['prefix'] = os.getenv("SWIFT_PREFIX")
31+ swift_config['region'] = os.getenv("SWIFT_REGION")
32+ swift_config['tenant'] = os.getenv("SWIFT_TENANT")
33+ swift_config['username'] = os.getenv("SWIFT_USERNAME")
34+ swift_config['copy_to_swift'] = os.getenv("SWIFT_COPY_TO_SWIFT")
35+ swift_config['serve_from_swift'] = os.getenv("SWIFT_SERVE_FROM_SWIFT")
36+ swift_config['remove_local_file'] = os.getenv("SWIFT_REMOVE_LOCAL_FILE")
37+ enable_swift(swift_config)

Subscribers

People subscribed via source and target branches