Add is_cell0 helper method

This simplifies the task of checking if a CellMapping object is for
cell0 by adding a helper method.

Change-Id: I7e71ccfa0e1e6224cc807a2f27cd476ae705da99
This commit is contained in:
Andrew Laski
2016-09-15 10:35:26 -04:00
parent a4ca5f0ea0
commit e202a01491
4 changed files with 14 additions and 3 deletions

View File

@@ -104,6 +104,9 @@ class CellMapping(base.NovaTimestampObject, base.NovaObject):
def destroy(self):
self._destroy_in_db(self._context, self.uuid)
def is_cell0(self):
return self.obj_attr_is_set('uuid') and self.uuid == self.CELL0_UUID
@base.NovaObjectRegistry.register
class CellMappingList(base.ObjectListBase, base.NovaObject):