1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files

31 lines
632 B
Plaintext
Raw Normal View History

2020-04-14 10:45:36 -05:00
#!/usr/bin/env python
2018-11-08 19:45:21 +00:00
import logging
import os
import sys
import warnings
# supress warnings
warnings.filterwarnings("ignore")
2018-11-08 19:45:21 +00:00
2020-04-14 10:45:36 -05:00
# print "path", sys.path
2018-11-08 19:45:21 +00:00
try:
2020-04-14 10:45:36 -05:00
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mainsite.settings")
2018-11-08 19:45:21 +00:00
from django.core.management import execute_from_command_line
inp = sys.stdin.readline().strip()
2018-12-07 13:49:50 -08:00
if inp:
2020-04-14 10:45:36 -05:00
argv = ["in.whoisd", "pdb_whois", inp]
2018-12-07 13:49:50 -08:00
execute_from_command_line(argv)
2018-11-08 19:45:21 +00:00
except BaseException as e:
# TODO log here - need to inherit
2020-04-14 10:45:36 -05:00
# log = logging.getLogger('pdb.script.whois')
# log.exception(e)
print(f"an error occurred: {e}")
2018-11-08 19:45:21 +00:00
pass