Skip to content

Commit

Permalink
Fixes the --tags argument for service_checks in dogshell (#387)
Browse files Browse the repository at this point in the history
* Fixes the --tags argument for service_checks in dogshell

* strip when checking if truthy
  • Loading branch information
zippolyte committed Jun 4, 2019
1 parent 3585995 commit 6a4230f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion datadog/dogshell/service_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ def setup_parser(cls, subparsers):
def _check(cls, args):
api._timeout = args.timeout
format = args.format
if args.tags:
tags = sorted(set([t.strip() for t in args.tags.split(',') if t.strip()]))
else:
tags = None
res = api.ServiceCheck.check(
check=args.check, host_name=args.host_name, status=int(args.status),
timestamp=args.timestamp, message=args.message, tags=args.tags)
timestamp=args.timestamp, message=args.message, tags=tags)
report_warnings(res)
report_errors(res)
if format == 'pretty':
Expand Down

0 comments on commit 6a4230f

Please sign in to comment.