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:// 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
# 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"
PREFIX = "@prefix@"
DATAROOTDIR = "@datarootdir@"
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
'''https connection request handler.
Supports Markdown
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