https://codereview.appspot.com/5957043/diff/1/juju/control/constraints_get.py#newcode51
juju/control/constraints_get.py:51: yield
esm.set_config_state(env_config, environment.name)
so why are we syncing env on get-constraints.. the constraints are
already actualized on the object being inspected. if its a legacy
environment we should just log warning and exit.
https://codereview.appspot.com/5957043/diff/1/juju/control/tests/test_initialize.py#newcode41
juju/control/tests/test_initialize.py:41: def test_bad_data(self):
general comment, its really nice to have doc strings on tests for other
devs, even if its just a single line to express intent, and assuming the
test name itself isn't obvious. ie test_bad_constraints_data or
this is a test that the admin initialize exits 1 on bad constraints
data.
https://codereview.appspot.com/5957043/diff/3001/juju/control/constraints_set.py#newcode90
juju/control/constraints_set.py:90: yield
esm.set_config_state(env_config, environment.name)
i'd appreciate if you could document the rationale for syncing as
applying to constraints, perhaps in an internals doc, referenced by the
relevant code points. This will make it much easier to keep the code
concerns in mind when the sync goes away.
LGTM, some minors on docs.
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ constraints_ get.py constraints_ get.py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ constraints_ get.py# newcode51 constraints_ get.py: 51: yield config_ state(env_ config, environment.name)
juju/control/
esm.set_
so why are we syncing env on get-constraints.. the constraints are
already actualized on the object being inspected. if its a legacy
environment we should just log warning and exit.
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ constraints_ set.py constraints_ set.py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ constraints_ set.py# newcode90 constraints_ set.py: 90: yield config_ state(env_ config, environment.name)
juju/control/
esm.set_
Some comments on the reasoning for this here and in get-constraints
would be good.
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ tests/test_ bootstrap. py tests/test_ bootstrap. py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ tests/test_ bootstrap. py#newcode7 tests/test_ bootstrap. py:7: from juju.lib.mocker import ANY
juju/control/
not needed.
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ tests/test_ initialize. py tests/test_ initialize. py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/1/ juju/control/ tests/test_ initialize. py#newcode41 tests/test_ initialize. py:41: def test_bad_ data(self) : constraints_ data or
juju/control/
general comment, its really nice to have doc strings on tests for other
devs, even if its just a single line to express intent, and assuming the
test name itself isn't obvious. ie test_bad_
this is a test that the admin initialize exits 1 on bad constraints
data.
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/agents/ tests/test_ provision. py tests/test_ provision. py (right):
File juju/agents/
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/agents/ tests/test_ provision. py#newcode56 tests/test_ provision. py:56: reactor. callLater( 0.3, default_ config, False) s=False invocation, its a bit
juju/agents/
self.push_
nitpick, please use the with_constraint
easier to grok what the value is doing without hunting for the method
def.
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/control/ constraints_ get.py constraints_ get.py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/control/ constraints_ get.py# newcode57 constraints_ get.py: 57: entity = yield machine_ state(name)
juju/control/
msm.get_
what do you think an info log message describing the entity for which
the constraints are being retrieved.
ie. log.info("Fetching constraints for service %s", entity)
log.info("Fetching constriants for environment")
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/control/ constraints_ set.py constraints_ set.py (right):
File juju/control/
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/control/ constraints_ set.py# newcode90 constraints_ set.py: 90: yield config_ state(env_ config, environment.name)
juju/control/
esm.set_
i'd appreciate if you could document the rationale for syncing as
applying to constraints, perhaps in an internals doc, referenced by the
relevant code points. This will make it much easier to keep the code
concerns in mind when the sync goes away.
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/state/ environment. py environment. py (right):
File juju/state/
https:/ /codereview. appspot. com/5957043/ diff/3001/ juju/state/ environment. py#newcode49 environment. py:49: provider = get_default( ).get_machine_ provider( )
juju/state/
config.
hmm.. this is a red flag, ie the only callers here should be privileged
things (cli or provisioning agent), a doc string on the method would be
good.
https:/ /codereview. appspot. com/5957043/