Merge lp:~jimbaker/pyjuju/juju-status-expose-hint into lp:pyjuju
Proposed by
Jim Baker
Status: | Merged |
---|---|
Approved by: | Kapil Thangavelu |
Approved revision: | 537 |
Merged at revision: | 554 |
Proposed branch: | lp:~jimbaker/pyjuju/juju-status-expose-hint |
Merge into: | lp:pyjuju |
Diff against target: |
49 lines (+8/-3) 2 files modified
juju/control/status.py (+5/-1) juju/control/tests/test_status.py (+3/-2) |
To merge this branch: | bzr merge lp:~jimbaker/pyjuju/juju-status-expose-hint |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Approve | ||
Review via email: mp+106474@code.launchpad.net |
Description of the change
juju status should hint that a service may need to be exposed
Adjust juju status so that exposed: false is output for a service if there are open ports but not exposed
To post a comment you must log in.
Reviewers: mp+106474_ code.launchpad. net,
Message:
Please take a look.
Description:
juju status should hint that a service may need to be exposed
Adjust juju status so that exposed: false is output for a service if
there are open ports but not exposed
https:/ /code.launchpad .net/~jimbaker/ juju/juju- status- expose- hint/+merge/ 106474
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6206086/
Affected files: status. py tests/test_ status. py
A [revision details]
M juju/control/
M juju/control/
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: juju/control/ status. py status. py' status. py 2012-04-15 23:03:05 +0000 status. py 2012-05-18 21:41:15 +0000
if unit_connected else "down"
=== modified file 'juju/control/
--- juju/control/
+++ juju/control/
@@ -311,10 +311,14 @@
exposed = self.service_ data[service. service_ name].get( "exposed" ) open_ports( ) open_ports( )
u["open- ports"] = ["{port} /{proto} ".format( **port_ info)
for port_info in open_ports] data[service. service_ name][" exposed" ] = False
+ open_ports = yield unit.get_
if exposed:
- open_ports = yield unit.get_
+ elif open_ports:
+ # Ensure a hint is provided that there are open ports if
+ # not exposed by setting the key in the output
+ self.service_
Index: juju/control/ tests/test_ status. py tests/test_ status. py' tests/test_ status. py 2012-04-09 19:40:57 +0000 tests/test_ status. py 2012-05-18 21:41:15 +0000
self. assertEqual(
services[ "wordpress" ],
{"charm" : "local: series/ wordpress- 3",
"relations" : {
"cache" : ["memcache"],
"db": ["mysql"],
self. assertEqual( set(services[ "varnish" ].keys( )),
set( ["exposed" , "charm", "relations", "units"]))
self. assertEqual( set(services[ "wordpress" ].keys( )),
=== modified file 'juju/control/
--- juju/control/
+++ juju/control/
@@ -425,6 +425,7 @@
+ "exposed": False,
@@ -624,7 +625,7 @@
- set(["charm", "relations", "units"]))
+ set(["charm", "exposed", "relations", "units"]))
for service in services. itervalues( ):
self.assertGrea terEqual( # may also include "exposed" key
self. assertEqual( set(services[ "varnish" ].keys( )),
set( ["exposed" , "charm", "relations", "units"]))
self. assertEqual( set(services[ "wordpress" ].keys( )),
@@ -671,7 +672,7 @@
- set(["charm", "relations", "units"]))
+ set(["charm", "exposed", "relations", "units"]))
for service in services. itervalues( ):
self.assertTrue ...