Merge "Housekeeper: Per-job readonly option"
This commit is contained in:
commit
00acf10266
@ -709,6 +709,10 @@ nsxv_opts = [
|
||||
cfg.ListOpt('housekeeping_jobs',
|
||||
default=['error_dhcp_edge', 'error_backup_edge'],
|
||||
help=_("List of the enabled housekeeping jobs")),
|
||||
cfg.ListOpt('housekeeping_readonly_jobs',
|
||||
default=[],
|
||||
help=_("List of housekeeping jobs which are enabled in read "
|
||||
"only mode")),
|
||||
cfg.BoolOpt('housekeeping_readonly',
|
||||
default=True,
|
||||
help=_("Housekeeping will only warn about breakage.")),
|
||||
|
@ -16,6 +16,7 @@
|
||||
import abc
|
||||
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
import six
|
||||
|
||||
@ -25,7 +26,10 @@ LOG = log.getLogger(__name__)
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class BaseJob(object):
|
||||
def __init__(self, readonly):
|
||||
self.readonly = readonly
|
||||
self.readonly = readonly or (self.get_name() in
|
||||
cfg.CONF.nsxv.housekeeping_readonly_jobs)
|
||||
LOG.info('Housekeeping: %s job initialized in %s mode',
|
||||
self.get_name(), 'RO' if self.readonly else 'RW')
|
||||
self.plugin = directory.get_plugin()
|
||||
|
||||
@abc.abstractmethod
|
||||
|
Loading…
Reference in New Issue
Block a user