Merge lp:~fwereade/pyjuju/private-cloud-fixes into lp:~fwereade/pyjuju/shadow-trunk-1204
Proposed by
William Reade
Status: | Merged |
---|---|
Approved by: | William Reade |
Approved revision: | 511 |
Merged at revision: | 511 |
Proposed branch: | lp:~fwereade/pyjuju/private-cloud-fixes |
Merge into: | lp:~fwereade/pyjuju/shadow-trunk-1204 |
Diff against target: |
202 lines (+37/-43) 6 files modified
juju/control/legacy.py (+10/-25) juju/control/tests/test_add_unit.py (+3/-6) juju/control/tests/test_deploy.py (+2/-6) juju/providers/ec2/__init__.py (+9/-4) juju/providers/ec2/tests/test_provider.py (+12/-1) juju/providers/ec2/utils.py (+1/-1) |
To merge this branch: | bzr merge lp:~fwereade/pyjuju/private-cloud-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Reade | Pending | ||
Review via email: mp+99810@code.launchpad.net |
Description of the change
Small fixes:
* Private EC2 clouds no longer expose constraints
* deploy/add-unit no longer pointlessly warn about legacy keys which remain
necessary in legacy environments
To post a comment you must log in.
Reviewers: mp+99810_ code.launchpad. net,
Message:
Please take a look.
Description:
Small fixes:
* Private EC2 clouds no longer expose constraints
* deploy/add-unit no longer pointlessly warn about legacy keys which
remain
necessary in legacy environments
https:/ /code.launchpad .net/~fwereade/ juju/private- cloud-fixes/ +merge/ 99810
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5933058/
Affected files: legacy. py tests/test_ add_unit. py tests/test_ deploy. py ec2/__init_ _.py ec2/tests/ test_provider. py ec2/utils. py
A [revision details]
M juju/control/
M juju/control/
M juju/control/
M juju/providers/
M juju/providers/
M juju/providers/
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/ legacy. py legacy. py' legacy. py 2012-03-26 13:26:58 +0000 legacy. py 2012-03-28 19:48:24 +0000 internet. defer import inlineCallbacks
=== modified file 'juju/control/
--- juju/control/
+++ juju/control/
@@ -1,41 +1,26 @@
-import sys
-
from twisted.
from juju.errors import JujuError environment import EnvironmentStat eManager
from juju.state.
-_WARNING = """
-WARNING: Your environments.yaml contains deprecated keys; changes to these
keys
-will no longer be propagated. The affected keys are:
-"""
-
_ERROR = """
Your environments.yaml contains deprecated keys; they must not be used
other
than in legacy deployments. The affected keys are:
-"""
-
-_INFO = """
-%s
-This %s can be resolved according to the instructions available at:
+
+ %s
+
+This error can be resolved according to the instructions available at:
https:/ /juju.ubuntu. com/DeprecatedE nvironmentSetti ngs
"""
-def _format_keys(keys): sorted( keys)) keys(keys) , "warning") keys(keys) , "error")) sorted( keys)))
- return " %s\n" % "\n ".join(
-
-def warn(keys):
- print >>sys.stderr, _WARNING + _INFO % (_format_
-
def error(keys):
- raise JujuError(_ERROR + _INFO % (_format_
+ raise JujuError(_ERROR % "\n ".join(
@inlineCallbacks nt(client, keys): eManager( client) in_legacy_ environment( )): eManager( client) in_legacy_ environment( )):
def check_environme
- if keys:
- esm = EnvironmentStat
- if (yield esm.get_
- warn(keys)
- else:
- error(keys)
+ if not keys:
+ return
+ esm = EnvironmentStat
+ if not (yield esm.get_
+ error(keys)
Index: juju/control/ tests/test_ add_unit. py tests/test_ add_unit. py' tests/test_ add_unit. py 2012-03-27 23:56:09 +0000 tests/test_ add_unit. py 2012-03-28 19:48:24 +0000 machine_ assignments( "mysql" , [0, 0])
=== modified file 'juju/control/
--- juju/control/
+++ juju/control/
@@ -145,27 +145,24 @@
yield self.assert_
@ inlineCallbacks option_ warning( self): option_ in_legacy_ env(self) :
"environments" : {"firstenv": {
"some- legacy- key": "blah...
- def test_legacy_
+ def test_legacy_
config = {