Merge lp://staging/~adam-collard/landscape-client/juju-info-at-registration into lp://staging/~landscape/landscape-client/trunk
Proposed by
Adam Collard
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Adam Collard | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 733 | ||||
Proposed branch: | lp://staging/~adam-collard/landscape-client/juju-info-at-registration | ||||
Merge into: | lp://staging/~landscape/landscape-client/trunk | ||||
Diff against target: |
614 lines (+240/-118) 13 files modified
landscape/broker/registration.py (+69/-51) landscape/broker/tests/helpers.py (+3/-0) landscape/broker/tests/test_registration.py (+38/-7) landscape/deployment.py (+5/-0) landscape/lib/juju.py (+26/-0) landscape/lib/tests/test_encoding.py (+1/-1) landscape/lib/tests/test_juju.py (+62/-0) landscape/message_schemas.py (+10/-4) landscape/monitor/config.py (+0/-7) landscape/monitor/jujuinfo.py (+4/-22) landscape/monitor/tests/test_config.py (+0/-11) landscape/monitor/tests/test_jujuinfo.py (+9/-12) landscape/tests/test_deployment.py (+13/-3) |
||||
To merge this branch: | bzr merge lp://staging/~adam-collard/landscape-client/juju-info-at-registration | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Björn Tillenius (community) | Approve | ||
Alberto Donato | Approve | ||
Review via email: mp+187836@code.staging.launchpad.net |
Commit message
Add Juju information at registration time.
* Changed schema of JUJU_INFO message to be strict about the keys
* Re-used schema for REGISTER and REGISTER_CLOUD_VM messages
* Added l.lib.juju as resting ground for json parsing and error handling
* Moved juju_filename to main config object, not just specific to monitor
Description of the change
Add Juju information at registration time.
* Changed schema of JUJU_INFO message to be strict about the keys
* Re-used schema for REGISTER and REGISTER_CLOUD_VM messages
* Added l.lib.juju as resting ground for json parsing and error handling
* Moved juju_filename to main config object, not just specific to monitor
To post a comment you must log in.
+1, looks good!
#1: on_info = {} on_info[ "environment- uuid"] = juju_info[ on_info[ "api-addresses" ] = juju_info[ ].split( ) on_info[ "unit-name" ] = juju_info[ "unit-name" ]
+ juju_registrati
+ juju_registrati
+ "environment-uuid"]
+ juju_registrati
+ "api-addresses"
+ juju_registrati
I think the juju_info[ "api-addresses" ].split( ) should me moved inside get_juju_info(), since there are currently two places where the split is performed after getting the info.
As a result this could we written as
+ juju_registrati on_info = dict( uuid", "api-addresses", "unit-name"])
+ (key, value) for key, value in juju_info
+ if key in ["environment-
#2:
+import os.path
Please use "from os import path" instead.
#3: LandscapeTest) :
+class JujuTest(
Tests in this class don't have docstrings.
#4: l("DEAD- BEEF", juju_info[ "environment- uuid"]) l("juju- unit-name" , juju_info[ "unit-name" ]) l("10.0. 3.1:17070" , juju_info[ "api-addresses" ]) l("127. 0.0.1", juju_info[ "private- address" ])
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
It'd be better to compare juju_info with an expected dict, to ensure there are no extra keys.