Files
deb-nova/nova/objects/host_mapping.py
Andrey Volkov daad6c26ec Fix host mapping saving
Changes return ability to use HostMapping.save method,
it was broken.

It fixes two issues:
- HostMapping._save_in_db got unexpected parameter
  (self.host instead of self object from the save call).
  It's clear.

- "sqlalchemy.orm.exc.DetachedInstanceError: Parent instance
  <HostMapping> is not bound to a Session;"
  while trying to get the cell_mapping attribute on saved HostMapping
  instance.

  As HostMapping cannot be without cell_mapping, solution is to load
  cell_mapping attribute just after getting it from DB.
  To be consistent I used the code from _create_in_db method.

Closes-bug: 1595587
Change-Id: Ia2e427f5bd4ab43d1c273de72ef7bb8c01d8d1af
2016-07-15 08:49:45 +03:00

5.3 KiB