Merge ~xavpaice/charm-openstack-service-checks/+git/charm-openstack-service-checks:swift_checks into ~canonical-bootstack/charm-openstack-service-checks:master

Proposed by Xav Paice
Status: Merged
Approved by: James Hebden
Approved revision: 3bb89a54500bbbdaed3470404842c10038a6cee2
Merged at revision: ac22034009fc7e8b40ed3e7ea93ccce2ba3e305b
Proposed branch: ~xavpaice/charm-openstack-service-checks/+git/charm-openstack-service-checks:swift_checks
Merge into: ~canonical-bootstack/charm-openstack-service-checks:master
Diff against target: 70 lines (+13/-8)
2 files modified
config.yaml (+6/-0)
reactive/service_checks.py (+7/-8)
Reviewer Review Type Date Requested Status
James Hebden (community) Approve
Andrea Ieri (community) Needs Information
Alok G Singh (community) Approve
Review via email: mp+363815@code.launchpad.net

Commit message

Add swift_check_params config

To post a comment you must log in.
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
Alok G Singh (alephnull-b) wrote :

LGTM.

review: Approve
Revision history for this message
Andrea Ieri (aieri) wrote :

comment inline

review: Needs Information
Revision history for this message
Xav Paice (xavpaice) wrote :

Have edited as suggested by Andrea (thanks for that!).

Revision history for this message
James Hebden (ec0) wrote :

LGMT

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

Change successfully merged at revision ac22034009fc7e8b40ed3e7ea93ccce2ba3e305b

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index b71208c..b153340 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -73,3 +73,9 @@ options:
6 default: True
7 description: |
8 If true, create NRPE checks matching all 'admin' URLs in the Keystone catalog.
9+ swift_check_params:
10+ type: string
11+ description: |
12+ URL to use with check_http if there is a Swift endpoint. Default is '/', but it's possible to add extra params,
13+ e.g. '/v3 -e Unauthorized -d x-openstack-request-id' or a different url, e.g. '/healthcheck'. Mitaka Swift
14+ typically needs '/healthcheck'.
15diff --git a/reactive/service_checks.py b/reactive/service_checks.py
16index f519f26..1a6f5bb 100644
17--- a/reactive/service_checks.py
18+++ b/reactive/service_checks.py
19@@ -42,8 +42,7 @@ def configure_ident_username(keystone):
20
21 @when('identity-credentials.available')
22 def save_creds(keystone):
23- """
24- Collect and save credentials from Keystone relation.
25+ """Collect and save credentials from Keystone relation.
26
27 Get credentials from the Keystone relation,
28 reformat them into something the Keystone client
29@@ -82,8 +81,7 @@ def save_creds(keystone):
30 # allow user to override credentials (and the need to be related to Keystone)
31 # with 'os-credentials'
32 def get_credentials():
33- """
34- Get credential info from either config or relation data.
35+ """Get credential info from either config or relation data.
36
37 If config 'os-credentials' is set, return that info otherwise look for for a keystonecreds relation data.
38
39@@ -217,8 +215,7 @@ def fix_ssl():
40
41
42 def create_endpoint_checks():
43- """
44- Create an NRPE check for each Keystone catalog endpoint.
45+ """Create an NRPE check for each Keystone catalog endpoint.
46
47 Read the Keystone catalog, and create a check for each endpoint listed.
48 If there is a healthcheck endpoint for the API, use that URL, otherwise check
49@@ -235,8 +232,11 @@ def create_endpoint_checks():
50 'cinderv3': '/v3 -e Unauthorized -d x-openstack-request-id',
51 'cinderv2': '/v2 -e Unauthorized -d x-openstack-request-id',
52 'cinderv1': '/v1 -e Unauthorized -d x-openstack-request-id',
53+ 'ceilometer': '/ -e Unauthorized -d x-openstack-request-id',
54+ 'placement': '/healthcheck -e Unauthorized -d x-openstack-request-id',
55 'glance': '/healthcheck',
56 'nova': '/healthcheck',
57+ 'swift': config.get('swift_check_params', '/'),
58 }
59
60 creds = get_credentials()
61@@ -295,8 +295,7 @@ def create_endpoint_checks():
62
63
64 def get_keystone_client(creds):
65- """
66- Import the appropriate Keystone client depending on API version.
67+ """Import the appropriate Keystone client depending on API version.
68
69 Use credential info to determine the Keystone API version, and make a client session object that is to be
70 used for authenticated communication with Keystone.

Subscribers

People subscribed via source and target branches