-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --no-warn-on-updates option #408
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ def __init__(self): | |
self.all_updates = False | ||
self.no_cache_update = False | ||
self.no_warn_on_lock = False | ||
self.no_warn_on_updates = False | ||
self.enable_repo = "" | ||
self.disable_repo = "" | ||
self.disable_plugin = "" | ||
|
@@ -570,7 +571,10 @@ def test_all_updates(self): | |
status = OK | ||
message = "0 Updates Available" | ||
else: | ||
status = CRITICAL | ||
if self.no_warn_on_updates: | ||
status = OK | ||
else: | ||
status = CRITICAL | ||
if num_updates == 1: | ||
message = "1 Update Available" | ||
else: | ||
|
@@ -594,7 +598,10 @@ def test_security_updates(self): | |
status = OK | ||
message = "0 Security Updates Available" | ||
else: | ||
status = CRITICAL | ||
if self.no_warn_on_updates: | ||
status = OK | ||
else: | ||
status = CRITICAL | ||
if num_security_updates == 1: | ||
message = "1 Security Update Available" | ||
elif num_security_updates > 1: | ||
|
@@ -603,7 +610,10 @@ def test_security_updates(self): | |
|
||
if num_other_updates != 0: | ||
if self.warn_on_any_update and status != CRITICAL: | ||
status = WARNING | ||
if self.no_warn_on_updates: | ||
status = OK | ||
else: | ||
status = WARNING | ||
if num_other_updates == 1: | ||
message += ". 1 Non-Security Update Available" | ||
else: | ||
|
@@ -684,6 +694,15 @@ def main(): | |
+ "intermittently pop up when someone is running " \ | ||
+ "yum for package management") | ||
|
||
parser.add_option("--no-warn-on-updates", | ||
action="store_true", | ||
dest="no_warn_on_updates", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
help="Return OK instead of WARNING even when updates are" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation contains mixed spaces and tabs |
||
+ "available. This is not recommended from the security" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
+ "standpoint, but may be wanted to disable alerts while" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
+ "the plugin output still shows the number of available" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
+ "updates.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. continuation line under-indented for visual indent |
||
|
||
parser.add_option("-e", | ||
"--enablerepo", | ||
dest="repository_to_enable", | ||
|
@@ -738,6 +757,7 @@ def main(): | |
tester.all_updates = options.all_updates | ||
tester.no_cache_update = options.no_cache_update | ||
tester.no_warn_on_lock = options.no_warn_on_lock | ||
tester.no_warn_on_updates = options.no_warn_on_updates | ||
tester.enable_repo = options.repository_to_enable | ||
tester.disable_repo = options.repository_to_disable | ||
tester.disable_plugin = options.plugin_to_disable | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
indentation contains mixed spaces and tabs
indentation contains tabs