Support both Ubuntu and CentOS
CentOS installs molteniron into /usr/etc/molteniron instead of /usr/local/etc/molteniron/ so we have moved the conf.yaml file into the molteniron Python directory and started using pkg_resources.resource_filename to find our data file. Change-Id: I75330d51475051a04bb2dff903f54727b9be9b6e
This commit is contained in:
parent
4c4609e10c
commit
b3b6dda18d
|
@ -1,6 +1,7 @@
|
||||||
include AUTHORS
|
|
||||||
include ChangeLog
|
|
||||||
exclude .gitignore
|
exclude .gitignore
|
||||||
exclude .gitreview
|
exclude .gitreview
|
||||||
|
|
||||||
global-exclude *.pyc
|
global-exclude *.pyc
|
||||||
|
|
||||||
|
include AUTHORS
|
||||||
|
include ChangeLog
|
||||||
|
include molteniron/conf.yaml
|
||||||
|
|
|
@ -29,6 +29,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import molteniron
|
from molteniron import molteniron
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -77,11 +78,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
mi.setup_conf(conf)
|
mi.setup_conf(conf)
|
||||||
|
|
|
@ -25,15 +25,16 @@ This is a helper program for the MoltenIron server.
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import signal
|
|
||||||
import yaml
|
|
||||||
from daemonize import Daemonize
|
from daemonize import Daemonize
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
|
import signal
|
||||||
|
import sys
|
||||||
|
import yaml
|
||||||
|
|
||||||
PID = "/var/run/moltenirond.pid"
|
PID = "/var/run/moltenirond.pid"
|
||||||
YAML_CONF = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = None
|
||||||
ERROR_LOGFILE = "/tmp/MoltenIron-error-logfile"
|
ERROR_LOGFILE = "/tmp/MoltenIron-error-logfile"
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,6 +121,12 @@ if __name__ == "__main__":
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
|
else:
|
||||||
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
|
# Test for read ability
|
||||||
|
fobj = open(YAML_CONF, "r")
|
||||||
|
fobj.close()
|
||||||
|
|
||||||
if args.pid_dir:
|
if args.pid_dir:
|
||||||
if not os.path.isdir(args.pid_dir):
|
if not os.path.isdir(args.pid_dir):
|
||||||
|
|
|
@ -34,6 +34,7 @@ import calendar
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -1334,11 +1335,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
listener(conf)
|
listener(conf)
|
||||||
|
|
|
@ -26,6 +26,7 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -46,11 +47,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -88,11 +89,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -86,11 +87,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -88,11 +89,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -88,11 +89,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -26,6 +26,7 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -47,11 +48,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -26,6 +26,7 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -47,11 +48,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -26,6 +26,7 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -47,11 +48,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
|
@ -26,6 +26,7 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
from molteniron import moltenirond
|
from molteniron import moltenirond
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -47,11 +48,11 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as fobj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
request1 = {
|
request1 = {
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -34,6 +34,7 @@ setup(name="molteniron",
|
||||||
"molteniron/molteniron",
|
"molteniron/molteniron",
|
||||||
"utils/test_hook_mi_ipmiblob.py",
|
"utils/test_hook_mi_ipmiblob.py",
|
||||||
"utils/test_hook_mi_ipmiblob.sh"],
|
"utils/test_hook_mi_ipmiblob.sh"],
|
||||||
data_files=[("etc/molteniron/", ["conf.yaml"])],
|
package_data={"molteniron": ["*.yaml"]},
|
||||||
|
include_package_data=True,
|
||||||
setup_requires=['pbr'],
|
setup_requires=['pbr'],
|
||||||
pbr=True)
|
pbr=True)
|
||||||
|
|
36
tox.ini
36
tox.ini
|
@ -22,17 +22,13 @@ commands = mkdir -p testenv/var/run/
|
||||||
--install-scripts=testenv/bin/ \
|
--install-scripts=testenv/bin/ \
|
||||||
--install-purelib=testenv/lib/python2.7/site-packages/
|
--install-purelib=testenv/lib/python2.7/site-packages/
|
||||||
moltenirond-helper \
|
moltenirond-helper \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
--pid-dir=testenv/var/run/ \
|
--pid-dir=testenv/var/run/ \
|
||||||
start
|
start
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
delete_db
|
delete_db
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
add_baremetal test1 10.1.2.1 user password 10.1.2.3,10.1.2.4 de:ad:be:ef:00:01 ppc64el 8 2048 32
|
add_baremetal test1 10.1.2.1 user password 10.1.2.3,10.1.2.4 de:ad:be:ef:00:01 ppc64el 8 2048 32
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
add_keyvalue_pairs test2 \
|
add_keyvalue_pairs test2 \
|
||||||
10.1.2.2 \
|
10.1.2.2 \
|
||||||
10.1.2.5,10.1.2.6 \
|
10.1.2.5,10.1.2.6 \
|
||||||
|
@ -51,53 +47,39 @@ commands = mkdir -p testenv/var/run/
|
||||||
# passes in '\\{"ipmi_user": "user"\\}' which breaks json.loads()
|
# passes in '\\{"ipmi_user": "user"\\}' which breaks json.loads()
|
||||||
# ValueError: No JSON object could be decoded
|
# ValueError: No JSON object could be decoded
|
||||||
# molteniron \
|
# molteniron \
|
||||||
# --conf-dir=testenv/etc/molteniron/ \
|
|
||||||
# add_json_blob test3 \
|
# add_json_blob test3 \
|
||||||
# 10.1.2.3 \
|
# 10.1.2.3 \
|
||||||
# 10.1.2.7,10.1.2.8 \
|
# 10.1.2.7,10.1.2.8 \
|
||||||
# '{"ipmi_user": "user", "ipmi_password": "password", "port_hwaddr": "de:ad:be:ef:00:01", "cpu_arch": "ppc64el", "cpus": 8, "ram_mb": 2048, "disk_gb": 32''}'
|
# '{"ipmi_user": "user", "ipmi_password": "password", "port_hwaddr": "de:ad:be:ef:00:01", "cpu_arch": "ppc64el", "cpus": 8, "ram_mb": 2048, "disk_gb": 32''}'
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
allocate hamzy 1
|
allocate hamzy 1
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
get_field hamzy port_hwaddr
|
get_field hamzy port_hwaddr
|
||||||
molteniron \
|
molteniron \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
release hamzy
|
release hamzy
|
||||||
# Sadly needs a bash shell to run uuidgen
|
# Sadly needs a bash shell to run uuidgen
|
||||||
test_hook_mi_ipmiblob.sh
|
test_hook_mi_ipmiblob.sh
|
||||||
diff testenv/tmp/hardware_info molteniron/tests/hardware_info.good
|
diff testenv/tmp/hardware_info molteniron/tests/hardware_info.good
|
||||||
diff testenv/tmp/localrc molteniron/tests/localrc.good
|
diff testenv/tmp/localrc molteniron/tests/localrc.good
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testAllocateBM.py \
|
molteniron/tests/testAllocateBM.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testAddBMNode.py \
|
molteniron/tests/testAddBMNode.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testCull.py \
|
molteniron/tests/testCull.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testDeallocateBM.py \
|
molteniron/tests/testDeallocateBM.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testDeallocateOwner.py \
|
molteniron/tests/testDeallocateOwner.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testDoClean.py \
|
molteniron/tests/testDoClean.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testGetField.py \
|
molteniron/tests/testGetField.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testGetIps.py \
|
molteniron/tests/testGetIps.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
python \
|
python \
|
||||||
molteniron/tests/testRemoveBMNode.py \
|
molteniron/tests/testRemoveBMNode.py
|
||||||
--conf-dir=testenv/etc/molteniron/
|
|
||||||
moltenirond-helper \
|
moltenirond-helper \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
--pid-dir=testenv/var/run/ \
|
--pid-dir=testenv/var/run/ \
|
||||||
stop
|
stop
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ def main():
|
||||||
# This program is located in molteniron/utils/ directory.
|
# This program is located in molteniron/utils/ directory.
|
||||||
# The conf.yaml is located in the molteniron/ directory.
|
# The conf.yaml is located in the molteniron/ directory.
|
||||||
newPath = "/".join(dirs[:-2]) + "/"
|
newPath = "/".join(dirs[:-2]) + "/"
|
||||||
fobj = open(newPath + "conf.yaml", "r")
|
fobj = open(newPath + "molteniron/conf.yaml", "r")
|
||||||
conf = yaml.load(fobj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
# Create the SQL User
|
# Create the SQL User
|
||||||
|
|
|
@ -29,6 +29,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
from molteniron import molteniron
|
from molteniron import molteniron
|
||||||
import os
|
import os
|
||||||
|
from pkg_resources import resource_filename
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -72,12 +73,12 @@ if __name__ == "__main__":
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
yaml_file = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
YAML_CONF = os.path.realpath("%s/conf.yaml" % (args.conf_dir, ))
|
||||||
else:
|
else:
|
||||||
yaml_file = "/usr/local/etc/molteniron/conf.yaml"
|
YAML_CONF = resource_filename("molteniron", "conf.yaml")
|
||||||
|
|
||||||
with open(yaml_file, "r") as f_obj:
|
with open(YAML_CONF, "r") as fobj:
|
||||||
conf = yaml.load(f_obj)
|
conf = yaml.load(fobj)
|
||||||
|
|
||||||
mi.setup_conf(conf)
|
mi.setup_conf(conf)
|
||||||
mi.setup_parser(parser)
|
mi.setup_parser(parser)
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
test_hook_mi_ipmiblob.py \
|
test_hook_mi_ipmiblob.py \
|
||||||
--conf-dir=testenv/etc/molteniron/ \
|
|
||||||
--hardware-info=testenv/tmp/hardware_info \
|
--hardware-info=testenv/tmp/hardware_info \
|
||||||
--localrc=testenv/tmp/localrc \
|
--localrc=testenv/tmp/localrc \
|
||||||
$(uuidgen) \
|
$(uuidgen) \
|
||||||
|
|
Loading…
Reference in New Issue