1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
Stefan Pratter 36489e2921 use debug print (#1460)
* use debug print

* suppress python warnings during whois
2023-10-25 09:48:52 -05:00

31 lines
632 B
Python
Executable File

#!/usr/bin/env python
import logging
import os
import sys
import warnings
# supress warnings
warnings.filterwarnings("ignore")
# print "path", sys.path
try:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mainsite.settings")
from django.core.management import execute_from_command_line
inp = sys.stdin.readline().strip()
if inp:
argv = ["in.whoisd", "pdb_whois", inp]
execute_from_command_line(argv)
except BaseException as e:
# TODO log here - need to inherit
# log = logging.getLogger('pdb.script.whois')
# log.exception(e)
print(f"an error occurred: {e}")
pass