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:
@@ -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):
|
||||
|
Reference in New Issue
Block a user