self._warn_update_days = self.default_warn_update_days
self._crit_update_days = self.default_crit_update_days
self._nagios_mode = False
+ self._no_activity_check = False
description = _(
"Generates a list of all Puppets modules, which are newer "
def nagios_mode(self, value):
self._nagios_mode = to_bool(value)
+ # -----------------------------------------------------------
+ @property
+ def no_activity_check(self):
+ """Flag, that the last activities of modules should not be checked."""
+ return getattr(self, '_no_activity_check', False)
+
+ @no_activity_check.setter
+ def no_activity_check(self, value):
+ self._no_activity_check = to_bool(value)
+
# -------------------------------------------------------------------------
def as_dict(self, short=True):
"""
res['default_env'] = self.default_env
res['environment'] = self.environment
res['nagios_mode'] = self.nagios_mode
+ res['no_activity_check'] = self.no_activity_check
res['warn_update_days'] = self.warn_update_days
return res
help=_("Work in Nagios mode instead of sending mails.")
)
+ activity_group = self.arg_parser.add_mutually_exclusive_group()
+
+ activity_group.add_argument(
+ '-a', '--no-activity-check', dest='no_activity_check', action="store_true",
+ help=_("Don't perform a check about last activity in each module "
+ "(mutually exclusive with {m}).").format(m='--activity-check')
+ )
+
+ activity_group.add_argument(
+ '-A', '--activity-check', dest='no_activity_check', action="store_false",
+ help=_("Perform a check about last activity in each module (the default, "
+ "mutually exclusive with {m}).").format(m='--no-activity-check')
+ )
+
# -------------------------------------------------------------------------
def perform_arg_parser(self):
if self.args.nagios:
self.nagios_mode = True
+ if self.args.no_activity_check:
+ self.no_activity_check = True
+ else:
+ self.no_activity_check = False
+
LOG.debug("Warning level: {w} days, critical level: {c} days.".format(
w=self.warn_update_days, c=self.crit_update_days))
depr_infos = self.check_deprecations(module_infos)
self.generate_deprecation_msgs(depr_infos)
- update_infos = self.check_updates(module_infos)
- self.generate_update_msgs(update_infos)
+ if not self.no_activity_check:
+ update_infos = self.check_updates(module_infos)
+ self.generate_update_msgs(update_infos)
self.error_data.append("\n" + _("Checked at: {}").format(self.check_date_str))