Skip to content

Commit

Permalink
Specify comma-separated for restricted_roles
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreln-dd committed Dec 26, 2023
1 parent a7224e3 commit 56af17c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions datadog/dogshell/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setup_parser(cls, subparsers):
"--message", help="message to include with notifications" " for this monitor", default=None
)
post_parser.add_argument(
"--restricted_roles", help="list of unique role identifiers allowed to edit the monitor", default=None
"--restricted_roles", help="comma-separated list of unique role identifiers allowed to edit the monitor", default=None
)
post_parser.add_argument("--tags", help="comma-separated list of tags", default=None)
post_parser.add_argument(
Expand Down Expand Up @@ -78,7 +78,7 @@ def setup_parser(cls, subparsers):
)
update_parser.add_argument("--name", help="name of the alert", default=None)
update_parser.add_argument(
"--restricted_roles", help="list of unique role identifiers allowed to edit the monitor", default=None
"--restricted_roles", help="comma-separated list of unique role identifiers allowed to edit the monitor", default=None
)
update_parser.add_argument("--tags", help="comma-separated list of tags", default=None)
update_parser.add_argument(
Expand Down Expand Up @@ -158,7 +158,7 @@ def setup_parser(cls, subparsers):
"--message", help="message to include with notifications" " for this monitor", default=None
)
validate_parser.add_argument(
"--restricted_roles", help="list of unique role identifiers allowed to edit the monitor", default=None
"--restricted_roles", help="comma-separated list of unique role identifiers allowed to edit the monitor", default=None
)
validate_parser.add_argument("--tags", help="comma-separated list of tags", default=None)
validate_parser.add_argument("--options", help="json options for the monitor", default=None)
Expand Down Expand Up @@ -187,8 +187,6 @@ def _post(cls, args):
if args.restricted_roles:
restricted_roles = sorted(set([rr.strip() for rr in args.restricted_roles.split(",") if rr.strip()]))
body["restricted_roles"] = restricted_roles
else:
restricted_roles = None
if tags:
body["tags"] = tags
if args.priority:
Expand Down Expand Up @@ -438,8 +436,6 @@ def _validate(cls, args):
options = json.loads(args.options)
if args.restricted_roles:
to_update["restricted_roles"] = sorted(set([rr.strip() for rr in args.tags.split(",") if rr.strip()]))
else:
restricted_roles = None
if args.tags:
tags = sorted(set([t.strip() for t in args.tags.split(",") if t.strip()]))
else:
Expand Down

0 comments on commit 56af17c

Please sign in to comment.