Commit d5b8d3d8 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[2713] Use SYSCONFDIR for csv file

I know it's a different ticket but it seemed to easy not to do here

Also fixed a coupld of distcheck issues with .pyc files
parent 0da895c7
......@@ -4,7 +4,7 @@ sbin_SCRIPTS = b10-cmdctl-usermgr
b10_cmdctl_usermgrdir = $(pkgdatadir)
CLEANFILES= b10-cmdctl-usermgr
CLEANFILES= b10-cmdctl-usermgr b10-cmdctl-usermgr.pyc
man_MANS = b10-cmdctl-usermgr.8
DISTCLEANFILES = $(man_MANS)
......@@ -27,3 +27,7 @@ endif
b10-cmdctl-usermgr: b10-cmdctl-usermgr.py
$(SED) "s|@@PYTHONPATH@@|@pyexecdir@|" b10-cmdctl-usermgr.py >$@
chmod a+x $@
CLEANDIRS = __pycache__
clean-local:
rm -rf $(CLEANDIRS)
......@@ -19,6 +19,7 @@
This file implements user management program. The user name and
its password is appended to csv file.
'''
from bind10_config import SYSCONFPATH
import random
from hashlib import sha1
import csv
......@@ -31,7 +32,7 @@ import isc.util.process
isc.util.process.rename()
VERSION_STRING = 'b10-cmdctl-usermgr @PACKAGE_VERSION@'
DEFAULT_FILE = 'cmdctl-accounts.csv'
DEFAULT_FILE = SYSCONFPATH + '/cmdctl-accounts.csv'
class UserManager:
def __init__(self, options):
......
......@@ -19,6 +19,7 @@ import imp
import os
import subprocess
import unittest
from bind10_config import SYSCONFPATH
def run(command):
"""
......@@ -155,7 +156,8 @@ Options:
"""
# Hardcoded path .. should be ok since this is run from make check
usermgr = imp.load_source('usermgr', '../b10-cmdctl-usermgr.py')
self.assertEqual('cmdctl-accounts.csv', usermgr.DEFAULT_FILE)
self.assertEqual(SYSCONFPATH + '/cmdctl-accounts.csv',
usermgr.DEFAULT_FILE)
if __name__== '__main__':
unittest.main()
......
......@@ -24,11 +24,13 @@ def reload():
global PLUGIN_PATHS
global PREFIX
global LIBEXECPATH
global SYSCONFPATH
BIND10_MSGQ_SOCKET_FILE = os.path.join("@localstatedir@",
"@PACKAGE_NAME@",
"msgq_socket").replace("${prefix}",
"@prefix@")
PREFIX = "@prefix@"
SYSCONFPATH="@sysconfdir@/@PACKAGE@".replace('${prefix}', PREFIX)
# B10_FROM_SOURCE is set in the environment for internal tests and
# an experimental run without installagion. In that case we need to
......
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