https://codereview.appspot.com/6312050/diff/9001/juju/environment/config.py#newcode26
juju/environment/config.py:26: _OPENSTACK_AUTH_MODE = OneOf(
This could use a doc string, at least describing the correspondence to
ostack rels and what it entails wrt to the ostack setup, ie. is this a
user choice or a provider configuration matter. Eventually we'll start
dropping support for old ostack releases, and it will be good to
understand what bits correspond to what so we can keep this tidy.
EDIT: a ref to credentials.py for details would work
https://codereview.appspot.com/6312050/diff/9001/juju/providers/common/findzookeepers.py#newcode40
juju/providers/common/findzookeepers.py:40: % missing_instance_ids)
There's a broken test with this change not addressed by the branch. Its
not clear if this is adding value, rather than just leaking impl
details. i assume this is to help distinguish the int/str form of
openstack id provider.
its good to keep in mind and perhaps note here, if connectionLost method
callstack should return a deferred twisted will not wait on it before
proceeding and processing other things.
this method is also lacking any tests.
https://codereview.appspot.com/6312050/diff/9001/juju/providers/openstack/client.py#newcode131
juju/providers/openstack/client.py:131: def make_url(self, service,
parts):
minor. make_url should be prolly be private, since it requires
self.services which is not initialized in the constructor, so requires
internal knowledge to use properly in the correct initialization order.
https://codereview.appspot.com/6312050/diff/9001/juju/providers/openstack/launch.py#newcode67
juju/providers/openstack/launch.py:67: # For openstack deployments,
really need instance type and image id
instance type should be provided via constraints not config. image id
really wants for an external resource mapping (even if local) that takes
flavor ids and matches them to distros, else this ends up being a single
release provider.
https://codereview.appspot.com/6312050/diff/9001/juju/providers/openstack/launch.py#newcode91
juju/providers/openstack/launch.py:91: while not
server.get('addresses'):
please document this loop and why its nesc. inline. also the loop may
not even be nesc. given provider configuration which can have the ostack
provider automatically hand out floating addresses, which this code
doesn't check for. ie if auto_assign_floating_ip=True in nova-network
service.
https://codereview.appspot.com/6312050/diff/9001/juju/providers/openstack/launch.py#newcode109
juju/providers/openstack/launch.py:109: def
_assign_floating_ip(provider, server_id):
This feels like it could be restructured to better handle concurrency
around floating ip assignment, depending on the api behavior. ie move
assignment into loop conditional with try/except, and fall out to new
loop of allocation of new ip and try/except assignment. What's the exc
on assignment of already used ip? does it just magically move them
around?
review round 2
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/environmen t/config. py t/config. py (right):
File juju/environmen
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/environmen t/config. py#newcode26 t/config. py:26: _OPENSTACK_ AUTH_MODE = OneOf(
juju/environmen
This could use a doc string, at least describing the correspondence to
ostack rels and what it entails wrt to the ostack setup, ie. is this a
user choice or a provider configuration matter. Eventually we'll start
dropping support for old ostack releases, and it will be good to
understand what bits correspond to what so we can keep this tidy.
EDIT: a ref to credentials.py for details would work
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ common/ findzookeepers. py common/ findzookeepers. py (right):
File juju/providers/
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ common/ findzookeepers. py#newcode40 common/ findzookeepers. py:40: % missing_ instance_ ids)
juju/providers/
There's a broken test with this change not addressed by the branch. Its
not clear if this is adding value, rather than just leaking impl
details. i assume this is to help distinguish the int/str form of
openstack id provider.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ client. py openstack/ client. py (right):
File juju/providers/
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ client. py#newcode115 openstack/ client. py:115: body = yield onConnectionLos t
juju/providers/
reader.
please don't name instance attributes the same as framework methods,
thats very confusing, it looks like your yielding on a method instead of
its invocation here.
its good to keep in mind and perhaps note here, if connectionLost method
callstack should return a deferred twisted will not wait on it before
proceeding and processing other things.
this method is also lacking any tests.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ client. py#newcode131 openstack/ client. py:131: def make_url(self, service,
juju/providers/
parts):
minor. make_url should be prolly be private, since it requires
self.services which is not initialized in the constructor, so requires
internal knowledge to use properly in the correct initialization order.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ credentials. py openstack/ credentials. py (right):
File juju/providers/
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ credentials. py#newcode8 openstack/ credentials. py:8: TODO: rename 'nova-uri' to
juju/providers/
'auth-url'
re TODO b/c?
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ files.py openstack/ files.py (right):
File juju/providers/
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ files.py# newcode41 openstack/ files.py: 41: # XXX: what exactly is the
juju/providers/
expectation here?
already documented in the module doc string.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py openstack/ launch. py (right):
File juju/providers/
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode18 openstack/ launch. py:18: * Storing of server id needs to
juju/providers/
complete before cloud-init does the lookup.
While true this is silly. The delta here is an order of magnitude.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode67 openstack/ launch. py:67: # For openstack deployments,
juju/providers/
really need instance type and image id
instance type should be provided via constraints not config. image id
really wants for an external resource mapping (even if local) that takes
flavor ids and matches them to distros, else this ends up being a single
release provider.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode87 openstack/ launch. py:87: # cloud-init tries
juju/providers/
retrieving the id during boot.
This isn't even remotely possible.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode89 openstack/ launch. py:89: yield filestorage. put(id_ name, server[ 'id']))
juju/providers/
StringIO(
Has this issue been raised with upstream openstack? ie lack of access to
the ostack api machine id from the server.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode91 openstack/ launch. py:91: while not get('addresses' ): floating_ ip=True in nova-network
juju/providers/
server.
please document this loop and why its nesc. inline. also the loop may
not even be nesc. given provider configuration which can have the ostack
provider automatically hand out floating addresses, which this code
doesn't check for. ie if auto_assign_
service.
This block is also untested.
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode99 openstack/ launch. py:99: reactor. callLater( 5,
juju/providers/
deferred.callback, None)
This seems like quite a long poll period. Please add a debug log
statement here. also there is helper for this in lib/twistutils.py
https:/ /codereview. appspot. com/6312050/ diff/9001/ juju/providers/ openstack/ launch. py#newcode109 openstack/ launch. py:109: def floating_ ip(provider, server_id):
juju/providers/
_assign_
This feels like it could be restructured to better handle concurrency
around floating ip assignment, depending on the api behavior. ie move
assignment into loop conditional with try/except, and fall out to new
loop of allocation of new ip and try/except assignment. What's the exc
on assignment of already used ip? does it just magically move them
around?
https:/ /codereview. appspot. com/6312050/