Skip to content

Commit

Permalink
Updated to deal with configuration values not present in
Browse files Browse the repository at this point in the history
  /apt/apt.conf.d/10periodic
  • Loading branch information
JivanAmara committed Aug 6, 2014
1 parent d1fc303 commit 20f7f6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unattended_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def get_config_value(config_filename, config_value_regex):
]
config_filename = '/etc/apt/apt.conf.d/10periodic'
for cvr in config_variable_regexes:
val = int(get_config_value(config_filename, cvr))
val = get_config_value(config_filename, cvr)
val = None if val is None else int(val)
if not val:
print("CRITICAL - 'unattended-upgrades is not configured to run properly.\n"\
"In {}: {} is set to {}".format(config_filename, cvr, val))
print("CRITICAL - In {}: {} is set to {}".format(config_filename, cvr, val))
sys.exit(CRITICAL)
if cvr == config_variable_regexes[0]:
unattended_upgrade_period = val
Expand Down

0 comments on commit 20f7f6d

Please sign in to comment.