Skip to content

Commit

Permalink
Fixed incorrect total package counter
Browse files Browse the repository at this point in the history
Fixed a bug where total packages were calculated incorrectly (see also
issue #4)
  • Loading branch information
stdevel committed Nov 14, 2016
1 parent b4df35d commit ceb87a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions check_spacewalk_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def get_currency_data(stats_only=False):
system['hostname']=system_sid['name']
#get total package counter
upgradable_pkgs = client.system.listLatestUpgradablePackages(key, system['sid'])
system['all']=len(upgradable_pkgs)-1
if(len(upgradable_pkgs)>0): system['all']=len(upgradable_pkgs)-1
else: system['all']=0
#drop host if not requested
if options.all_systems == False:
if system['hostname'] not in options.system: system_currency[counter]=None
Expand All @@ -286,7 +287,7 @@ def get_currency_data(stats_only=False):
It is also possible to create an authfile (permissions 0600) for usage with this script. The first line needs to contain the username, the second line should consist of the appropriate password. If you're not defining variables or an authfile you will be prompted to enter your login information.
Checkout the GitHub page for updates: https://github.com/stdevel/check_spacewalk_currency'''
parser = OptionParser(description=desc,version="%prog version 0.5.5")
parser = OptionParser(description=desc,version="%prog version 0.5.6")

gen_opts = OptionGroup(parser, "Generic options")
space_opts = OptionGroup(parser, "Spacewalk options")
Expand Down
8 changes: 4 additions & 4 deletions icingaexchange.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ type: Plugin
license: gplv3
releases:
-
name: 0.5.5
description: "0.5.5 Release"
name: 0.5.6
description: "0.5.6 Release"
files:
-
name: check_spacewalk_currency.py
url: "file:///check_spacewalk_currency.py"
description: "Release 0.5.5"
checksum: 53b1ba76d033e4c42265bb75b06cb3dd
description: "Release 0.5.6"
checksum: bb12ecc6eea3d70879ecd787169855df

0 comments on commit ceb87a4

Please sign in to comment.