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
diff --git a/files/plugin_handler.py b/files/plugin_handler.py
index 4feb8f2..5c698af 100644
--- a/files/plugin_handler.py
+++ b/files/plugin_handler.py
@@ -83,6 +83,12 @@ def enable_openid(team_map):
83 add_option("openid_teams_trust_list", encoded_team_map)83 add_option("openid_teams_trust_list", encoded_team_map)
8484
8585
86def enable_swift(swift_config):
87 enable_plugin("openstack-objectstorage/objectstorage.php")
88 for k, v in swift_config.items():
89 add_option("object_storage_{}".format(k), v)
90
91
86def configure_wordpress():92def configure_wordpress():
87 url = "http://localhost"93 url = "http://localhost"
88 sleep_time = 1094 sleep_time = 10
@@ -128,3 +134,19 @@ if __name__ == "__main__":
128 team_map = os.getenv("WP_PLUGIN_OPENID_TEAM_MAP")134 team_map = os.getenv("WP_PLUGIN_OPENID_TEAM_MAP")
129 if team_map:135 if team_map:
130 enable_openid(team_map)136 enable_openid(team_map)
137
138 swift_url = os.getenv("SWIFT_URL")
139 if swift_url:
140 swift_config = {}
141 swift_config['url'] = swift_url
142 swift_config['auth_url' = os.getenv("SWIFT_AUTH_URL")
143 swift_config['bucket'] = os.getenv("SWIFT_BUCKET")
144 swift_config['password'] = os.getenv("SWIFT_PASSWORD")
145 swift_config['prefix'] = os.getenv("SWIFT_PREFIX")
146 swift_config['region'] = os.getenv("SWIFT_REGION")
147 swift_config['tenant'] = os.getenv("SWIFT_TENANT")
148 swift_config['username'] = os.getenv("SWIFT_USERNAME")
149 swift_config['copy_to_swift'] = os.getenv("SWIFT_COPY_TO_SWIFT")
150 swift_config['serve_from_swift'] = os.getenv("SWIFT_SERVE_FROM_SWIFT")
151 swift_config['remove_local_file'] = os.getenv("SWIFT_REMOVE_LOCAL_FILE")
152 enable_swift(swift_config)

Subscribers

People subscribed via source and target branches