Skip to content

Commit

Permalink
Merge branch 'master' into NRP-varnishes
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci authored Apr 17, 2024
2 parents 15fa014 + 8ee4e14 commit f67470e
Show file tree
Hide file tree
Showing 176 changed files with 6,800 additions and 823 deletions.
2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

22 changes: 14 additions & 8 deletions bin/osg-notify
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if __name__ == "__main__" and __package__ is None:
sys.path.append(_parent + "/src")

import topology_utils
from topology_utils import TopologyPoolManager
import net_name_addr_utils

# Parts of this implementation are from the following StackOverflow answer:
Expand Down Expand Up @@ -116,10 +117,9 @@ 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"],
help="Filter on contact type e.g. administrative, miscellaneous, security, submitter or site"
"(default: all)", )
oparser.add_argument("--oim-contact-type", action="append", dest="contact_type",
choices=["all"] + topology_utils.CONTACT_TYPES,
help="Filter on contact type (default: all)")
oparser.add_argument("--bypass-dns-check", action="store_true", dest="bypass_dns_check",
help="Bypass checking that one of the host's IP addresses matches with the hostanme resolution")
oparser.add_argument("--allow-non-ascii", action="store_true", dest="allow_non_ascii",
Expand All @@ -132,6 +132,10 @@ def parseargs():
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"]
args.contact_type = set(args.contact_type) # remove dupes

if args.from_name == 'security':
args.from_name = 'OSG Security Team'
args.from_addr = '[email protected]'
Expand Down Expand Up @@ -179,13 +183,14 @@ def has_non_printable_ascii_characters(contents):

def main():
args = parseargs()

pm = TopologyPoolManager()
recipients = set(args.recipients.split())
if args.oim_recipients and 'vos' in args.oim_recipients:
attempts = 3
while attempts > 0:
try:
results = topology_utils.get_vo_contacts(args)
results = pm.get_vo_contacts(args)
break
except topology_utils.InvalidPathError as exc:
print(exc)
exit(1)
Expand All @@ -208,9 +213,10 @@ def main():
while attempts > 0:
try:
if args.fqdn_filter:
results = topology_utils.get_resource_contacts_by_fqdn(args)
results = pm.get_resource_contacts_by_fqdn(args)
else:
results = topology_utils.get_resource_contacts(args)
results = pm.get_resource_contacts(args)
break
except topology_utils.InvalidPathError as exc:
exit(str(exc))
except topology_utils.IncorrectPasswordError as exc:
Expand Down
Loading

0 comments on commit f67470e

Please sign in to comment.