Merge "Don't advertise mute cells capabilities upwards"

This commit is contained in:
Jenkins 2013-06-19 02:02:20 +00:00 committed by Gerrit Code Review
commit 966b2ade8c
3 changed files with 12 additions and 7 deletions

View File

@ -44,8 +44,13 @@ cells_opts = [
help='Percentage of cell capacity to hold in reserve. '
'Affects both memory and disk utilization'),
cfg.StrOpt('cell_type',
default=None,
help='Type of cell: api or compute'),
default=None,
help='Type of cell: api or compute'),
cfg.IntOpt("mute_child_interval",
default=300,
help='Number of seconds after which a lack of capability and '
'capacity updates signals the child cell is to be '
'treated as a mute.'),
]
cfg.CONF.register_opts(cells_opts, group='cells')

View File

@ -42,6 +42,7 @@ LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('name', 'nova.cells.opts', group='cells')
CONF.import_opt('reserve_percent', 'nova.cells.opts', group='cells')
CONF.import_opt('mute_child_interval', 'nova.cells.opts', group='cells')
#CONF.import_opt('capabilities', 'nova.cells.opts', group='cells')
CONF.register_opts(cell_state_manager_opts, group='cells')
@ -340,6 +341,9 @@ class CellStateManager(base.Base):
capabs = copy.deepcopy(self.my_cell_state.capabilities)
if include_children:
for cell in self.child_cells.values():
if timeutils.is_older_than(cell.last_seen,
CONF.cells.mute_child_interval):
continue
for capab_name, values in cell.capabilities.items():
if capab_name not in capabs:
capabs[capab_name] = set([])

View File

@ -35,14 +35,10 @@ mute_weigher_opts = [
default=1000.0,
help='Weight value assigned to mute children. (The value '
'should be positive.)'),
cfg.IntOpt("mute_child_interval",
default=300,
help='Number of seconds after which a lack of capability and '
'capacity updates signals the child cell is to be '
'treated as a mute.')
]
CONF = cfg.CONF
CONF.import_opt('mute_child_interval', 'nova.cells.opts', group='cells')
CONF.register_opts(mute_weigher_opts, group='cells')