Code review comment for lp:~gz/pyjuju/os_scheduler_hints_1049858

Revision history for this message
Martin Packman (gz) wrote :

On 2012/10/29 11:51:37, jimbaker wrote:

> juju/providers/openstack/launch.py:95: hints =
> self._constraints["os-scheduler-hints"]
> Is this key guaranteed to be set? run_server does not assume it is
set, but the
> constraint is currently registered. However, the comments on that
registration
> muse that it might not be registered. Given the flow, maybe should
just be:

> hints = self._constraints.get("os-scheduler-hints")

This does look a little confusing, but see
machine.constraints.Constraints.__getitem__ - a KeyError is raised only
if the constraint key name does not exist, and the pre-registered
default is returned if no constraint of that name was given.

https://codereview.appspot.com/6783059/

« Back to merge proposal