Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glance / nova images refactoring #492

Open
glyph opened this issue Nov 16, 2015 · 0 comments
Open

glance / nova images refactoring #492

glyph opened this issue Nov 16, 2015 · 0 comments

Comments

@glyph
Copy link
Contributor

glyph commented Nov 16, 2015

Presently, the behavior of Glance / Nova images is broken in a few ways:

  • the glance API and the nova API should be presenting different views of the same underlying data; however, right now the glance image store on the session is holding a completely different set of data from the nova image store. As per discussion between @tawalton and @lekhajee offline, the existing glance plugin should be removed once the more thoroughly fleshed-out rackspace image support is implemented.
  • the internals of the nova API are coupled to the specific internals of the Rackspace images implementation; for example, as of The image store needs to be linked to a session #459 , in the (generic) mimic/model/nova_image_collection.py, we reference self.image_store.create_image_store, which is defined only in the (rackspace-specific) mimic/model/rackspace_image_store.py.
  • there is a lot of duplication, and an undocumented implicit abstract interface, shared among all the base classes for images, including glance_objects.Image, rackspace_images.Image, rackspace_images.RackspaceSavedImage, and rackspace_images.OnMetalImage . These should all be unified into a single class, since all these subclasses vary entirely in what data populates them, not in their behavior. This class should have all the necessary logic to translate the internal attributes of the image into the various formats it may need to be requested in - including the nova image list, the glance image list, and the nova detailed information resource.
  • the docstrings in all these modules really need to be brought up to a better quality standard - specifically, everything needs to say what types its arguments and return values are; if we had been more strictly enforcing that, it would have been clear that methods like get_image_by_id have no coherent type they could describe their return value with, which might have prevented some of this subclass sprawl. (So we will need a new interface or single implementation class to make it clear what "an image" is).

After this refactoring is done, only one image store class should exist, and it should probably live in the "glance" session, and nova should reference it, since nova is really just providing a view into Glance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant