Commit f91f820e authored by JINMEI Tatuya's avatar JINMEI Tatuya Committed by Jelte Jansen
Browse files

[2380] removed old loadzone source

parent 37cc046b
......@@ -1350,7 +1350,6 @@ AC_OUTPUT([doc/version.ent
src/bin/bindctl/tests/bindctl_test
src/bin/loadzone/run_loadzone.sh
src/bin/loadzone/tests/correct/correct_test.sh
src/bin/loadzone/b10-loadzone.py
src/bin/loadzone/loadzone.py
src/bin/usermgr/run_b10-cmdctl-usermgr.sh
src/bin/usermgr/b10-cmdctl-usermgr.py
......
/b10-loadzone
/b10-loadzone.py
/loadzone.py
/run_loadzone.sh
/b10-loadzone.8
#!@PYTHON@
# Copyright (C) 2010 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import sys; sys.path.append ('@@PYTHONPATH@@')
import re, getopt
import isc.datasrc
import isc.util.process
from isc.datasrc.master import MasterFile
import time
import os
isc.util.process.rename()
#########################################################################
# usage: print usage note and exit
#########################################################################
def usage():
print("Usage: %s [-d <database>] [-o <origin>] <file>" % sys.argv[0], \
file=sys.stderr)
exit(1)
#########################################################################
# main
#########################################################################
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "d:o:h", \
["dbfile", "origin", "help"])
except getopt.GetoptError as e:
print(str(e))
usage()
exit(2)
dbfile = '@@LOCALSTATEDIR@@/@PACKAGE@/zone.sqlite3'
initial_origin = ''
for o, a in opts:
if o in ("-d", "--dbfile"):
dbfile = a
elif o in ("-o", "--origin"):
if a[-1] != '.':
a += '.'
initial_origin = a
elif o in ("-h", "--help"):
usage()
else:
assert False, "unhandled option"
if len(args) != 1:
usage()
zonefile = args[0]
verbose = os.isatty(sys.stdout.fileno())
try:
master = MasterFile(zonefile, initial_origin, verbose)
except Exception as e:
sys.stderr.write("Error reading zone file: %s\n" % str(e))
exit(1)
try:
zone = master.zonename()
if verbose:
sys.stdout.write("Using SQLite3 database file %s\n" % dbfile)
sys.stdout.write("Zone name is %s\n" % zone)
sys.stdout.write("Loading file \"%s\"\n" % zonefile)
except Exception as e:
sys.stdout.write("\n")
sys.stderr.write("Error reading zone file: %s\n" % str(e))
exit(1)
try:
isc.datasrc.sqlite3_ds.load(dbfile, zone, master.zonedata)
if verbose:
master.closeverbose()
sys.stdout.write("\nDone.\n")
except Exception as e:
sys.stdout.write("\n")
sys.stderr.write("Error loading database: %s\n"% str(e))
exit(1)
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment