Merge lp:~johnsca/charms/trusty/cf-cloud-controller/hm9k into lp:~cf-charmers/charms/trusty/cf-cloud-controller/trunk

Proposed by Cory Johns
Status: Merged
Merged at revision: 32
Proposed branch: lp:~johnsca/charms/trusty/cf-cloud-controller/hm9k
Merge into: lp:~cf-charmers/charms/trusty/cf-cloud-controller/trunk
Diff against target: 76 lines (+25/-5)
4 files modified
hooks/cc-relation-changed (+11/-0)
hooks/config.py (+11/-1)
metadata.yaml (+1/-2)
templates/cloud_controller.yml (+2/-2)
To merge this branch: bzr merge lp:~johnsca/charms/trusty/cf-cloud-controller/hm9k
Reviewer Review Type Date Requested Status
Cloud Foundry Charmers Pending
Review via email: mp+221771@code.launchpad.net

Description of the change

Changes to the provided interface for HM9000

https://codereview.appspot.com/105770043/

To post a comment you must log in.
Revision history for this message
Cory Johns (johnsca) wrote :

Reviewers: mp+221771_code.launchpad.net,

Message:
Please take a look.

Description:
Changes to the provided interface for HM9000

https://code.launchpad.net/~johnsca/charms/trusty/cf-cloud-controller/hm9k/+merge/221771

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/105770043/

Affected files (+27, -5 lines):
   A [revision details]
   A hooks/cc-relation-changed
   M hooks/config.py
   M metadata.yaml
   M templates/cloud_controller.yml

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: metadata.yaml
=== modified file 'metadata.yaml'
--- metadata.yaml 2014-05-15 16:40:34 +0000
+++ metadata.yaml 2014-06-02 15:28:01 +0000
@@ -10,7 +10,7 @@
    - misc
  subordinate: false
  provides:
- provides-relation:
+ cc:
      interface: cf-cloud-controller
  requires:
    nats:
@@ -20,4 +20,3 @@
    db:
      interface: mysql
      optional: true
-

Index: hooks/cc-relation-changed
=== added file 'hooks/cc-relation-changed'
--- hooks/cc-relation-changed 1970-01-01 00:00:00 +0000
+++ hooks/cc-relation-changed 2014-06-02 15:28:01 +0000
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+# vim: et ai ts=4 sw=4:
+from charmhelpers.core import hookenv
+import config
+
+hookenv.relation_set(
+ hostname=config.API_CONTEXT['api']['hostname'],
+ port=config.API_CONTEXT['api']['port'],
+ user=config.API_CONTEXT['api']['user'],
+ password=config.API_CONTEXT['api']['password'],
+)

Index: hooks/config.py
=== modified file 'hooks/config.py'
--- hooks/config.py 2014-05-29 17:25:49 +0000
+++ hooks/config.py 2014-06-02 15:28:01 +0000
@@ -41,12 +41,22 @@
      hookenv.log("Finished db:migrate", hookenv.DEBUG)

+API_CONTEXT = contexts.StoredContext('api_credentials.yml', {
+ 'api': {
+ 'hostname': hookenv.unit_get('private-address').encode('utf-8'),
+ 'port': 9022,
+ 'user': host.pwgen(7),
+ 'password': host.pwgen(7),
+ }})
+
+
  SERVICES = [
      {
          'service': 'cf-cloudcontroller',
          'required_data': [contexts.NatsRelation(),
                            contexts.RouterRelation(),
- contexts.MysqlRelation()],
+ contexts.MysqlRelation(),
+ API_CONTEXT],
          'data_ready': [
              services.template(source='cf-cloudcontroller.conf',
                                target='/etc/init/cf-cloudcontroller.conf'),

Index: templates/cloud_controller.yml
=== modified file 'templates/cloud_controller.yml'
--- templates/cloud_controller.yml 2014-05-16 02:59:59 +0000
+++ templates/cloud_controller.yml 2014-06-02 16:06:35 +0000
@@ -21,8 +21,8 @@
  bootstrap_admin_email: admin@my-org

  bulk_api:
- auth_user: bulk_api
- auth_password: "Password"
+ auth_user: {{api['user']}}
+ auth_password: "{{api['password']}}"

  nginx:
    use_nginx: false

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'hooks/cc-relation-changed'
2--- hooks/cc-relation-changed 1970-01-01 00:00:00 +0000
3+++ hooks/cc-relation-changed 2014-06-02 17:50:06 +0000
4@@ -0,0 +1,11 @@
5+#!/usr/bin/env python
6+# vim: et ai ts=4 sw=4:
7+from charmhelpers.core import hookenv
8+import config
9+
10+hookenv.relation_set(
11+ hostname=config.API_CONTEXT['api']['hostname'],
12+ port=config.API_CONTEXT['api']['port'],
13+ user=config.API_CONTEXT['api']['user'],
14+ password=config.API_CONTEXT['api']['password'],
15+)
16
17=== modified file 'hooks/config.py'
18--- hooks/config.py 2014-05-29 17:25:49 +0000
19+++ hooks/config.py 2014-06-02 17:50:06 +0000
20@@ -41,12 +41,22 @@
21 hookenv.log("Finished db:migrate", hookenv.DEBUG)
22
23
24+API_CONTEXT = contexts.StoredContext('api_credentials.yml', {
25+ 'api': {
26+ 'hostname': hookenv.unit_get('private-address').encode('utf-8'),
27+ 'port': 9022,
28+ 'user': host.pwgen(7),
29+ 'password': host.pwgen(7),
30+ }})
31+
32+
33 SERVICES = [
34 {
35 'service': 'cf-cloudcontroller',
36 'required_data': [contexts.NatsRelation(),
37 contexts.RouterRelation(),
38- contexts.MysqlRelation()],
39+ contexts.MysqlRelation(),
40+ API_CONTEXT],
41 'data_ready': [
42 services.template(source='cf-cloudcontroller.conf',
43 target='/etc/init/cf-cloudcontroller.conf'),
44
45=== modified file 'metadata.yaml'
46--- metadata.yaml 2014-05-15 16:40:34 +0000
47+++ metadata.yaml 2014-06-02 17:50:06 +0000
48@@ -10,7 +10,7 @@
49 - misc
50 subordinate: false
51 provides:
52- provides-relation:
53+ cc:
54 interface: cf-cloud-controller
55 requires:
56 nats:
57@@ -20,4 +20,3 @@
58 db:
59 interface: mysql
60 optional: true
61-
62
63=== modified file 'templates/cloud_controller.yml'
64--- templates/cloud_controller.yml 2014-05-16 02:59:59 +0000
65+++ templates/cloud_controller.yml 2014-06-02 17:50:06 +0000
66@@ -21,8 +21,8 @@
67 bootstrap_admin_email: admin@my-org
68
69 bulk_api:
70- auth_user: bulk_api
71- auth_password: "Password"
72+ auth_user: {{api['user']}}
73+ auth_password: "{{api['password']}}"
74
75 nginx:
76 use_nginx: false

Subscribers

People subscribed via source and target branches