diff --git a/bin/osg-notify b/bin/osg-notify index b63140658..649895d78 100755 --- a/bin/osg-notify +++ b/bin/osg-notify @@ -116,8 +116,10 @@ def parseargs(): oparser.add_argument("--oim-owner-filter", dest="owner_vo", help="Filter on resources that list VO(s) as a partial owner") - oparser.add_argument("--oim-contact-type", default="all", dest="contact_type", - choices=["all", "administrative", "miscellaneous", "security", "submitter", "site"], + # should be safe to set default=set() here since we don't call parse_args() twice + oparser.add_argument("--oim-contact-type", action="append", default=set(), dest="contact_type", + choices=["all", "administrative", "miscellaneous", "security", "submitter", "site", + "local operational", "local security"], help="Filter on contact type e.g. administrative, miscellaneous, security, submitter or site" "(default: all)", ) oparser.add_argument("--bypass-dns-check", action="store_true", dest="bypass_dns_check", @@ -131,6 +133,8 @@ def parseargs(): oparser.error("--oim-owner-filter and --oim-recipients=vos options are conflicting") if args.name_filter and args.fqdn_filter: oparser.error("Can't specify both --oim-name-filter and --oim-fqdn-filter") + if not args.contact_type or ("all" in args.contact_type): + args.contact_type = ["all"] if args.from_name == 'security': args.from_name = 'OSG Security Team' diff --git a/src/topology_utils.py b/src/topology_utils.py index 28cc6da24..d1a30f49a 100644 --- a/src/topology_utils.py +++ b/src/topology_utils.py @@ -365,14 +365,15 @@ def filter_contacts(args, results): args.fqdn_filter not in fqdn: del results[fqdn] - if args.contact_type != 'all': + if 'all' not in args.contact_type: # filter out undesired contact types for name in list(results): contact_list = [] for contact in results[name]: contact_type = contact['ContactType'] - if contact_type.startswith(args.contact_type): - contact_list.append(contact) + for args_contact_type in args.contact_type: + if contact_type.startswith(args_contact_type): + contact_list.append(contact) if contact_list == []: del results[name] else: