Commit 614d9717 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

use the B10_FROM_SOURCE to also find the location of passwd.csv

(and, to prepare for future specfiles, for cmdctl.spec which isn't used yet afaik)


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@675 e5f2f494-b856-4b98-b285-d166d9295462
parent e5ce25b7
......@@ -2,6 +2,9 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
pkglibexec_SCRIPTS = b10-cmdctl
b10_cmdctldir = $(DESTDIR)$(pkgdatadir)
b10_cmdctl_DATA = passwd.csv
CLEANFILES= b10-cmdctl.py
# TODO: does this need $$(DESTDIR) also?
......
......@@ -27,6 +27,7 @@ resut to client.
'''
import sys; sys.path.append ('@@PYTHONPATH@@')
import os
import http.server
import urllib.parse
import json
......@@ -46,6 +47,18 @@ except ImportError:
URL_PATTERN = re.compile('/([\w]+)(?:/([\w]+))?/?')
USER_INFO_FILE = "passwd.csv"
CERTIFICATE_FILE = 'b10-cmdctl.pem'
# If B10_FROM_SOURCE is set in the environment, we use data files
# from a directory relative to that, otherwise we use the ones
# installed on the system
if "B10_FROM_SOURCE" in os.environ:
SPECFILE_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/cmdctl"
else:
PREFIX = "@prefix@"
DATAROOTDIR = "@datarootdir@"
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
SPECFILE_LOCATION = SPECFILE_PATH + "/cmdctl.spec"
USER_INFO_FILE = SPECFILE_PATH + "/passwd.csv"
class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
'''https connection request handler.
......
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