Skip to content

Commit 96f7893

Browse files
committed
fix ensure --extra-args is string and not None, if None it adds None word in the cmdline and breaks the commands
1 parent ca7462b commit 96f7893

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

curlnagios/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def parse_args(args):
4040

4141
parser.add_argument('-u', '--url', dest='url', nargs='?', default=None, const=None,
4242
help='url to check \n')
43-
parser.add_argument('-e', '--extra_args', dest='extra_args', nargs='?', default=None, const=None,
43+
parser.add_argument('-e', '--extra_args', dest='extra_args', nargs='?', default='', const=None,
4444
help='extra args to add to curl, see curl manpage \n')
4545

4646
# Arguments to check using OAuth2

curlnagios/plugin_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import subprocess
55

66
class curlCheck:
7-
def __init__(self, URL, extra_args, auth_args=''):
7+
def __init__(self, URL, extra_args='', auth_args=''):
88
"""
99
:param URL: provide url to get/put data.
1010
:param extra_args: any argument for curl command
@@ -36,7 +36,7 @@ def collect_data(self):
3636
"""
3737
### some code here
3838
### or calling external modules
39-
cmdline = "curl {} {} --fail -s -o /dev/null {} -w \\ {}".format(self.url, self.auth_args, self.extra_args, self.std_args)
39+
cmdline = "curl {} --fail -s -o /dev/null {} -w \\ {} {}".format(self.url, self.extra_args, self.std_args, self.auth_args)
4040

4141
retrcode, retroutput = subprocess.getstatusoutput(cmdline)
4242
jsonoutput = json.loads(retroutput)

upload.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)