Changed config system
diff --git a/xos/configurations/common/xos_common_config b/xos/configurations/common/xos_common_config
new file mode 100644
index 0000000..b86d618
--- /dev/null
+++ b/xos/configurations/common/xos_common_config
@@ -0,0 +1,45 @@
+[plc]
+name=plc
+deployment=plc
+
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+[api]
+host=localhost
+port=8000
+ssl_key=None
+ssl_cert=None
+ca_ssl_cert=None
+ratelimit_enabled=0
+omf_enabled=0
+mail_support_address=support@localhost
+nova_enabled=True
+logfile=/var/log/xos.log
+
+[nova]
+admin_user=admin@domain.com
+admin_password=admin
+admin_tenant=admin
+url=http://localhost:5000/v2.0/
+default_image=None
+default_flavor=m1.small
+default_security_group=default
+ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
+
+[observer]
+pretend=False
+backoff_disabled=False
+images_directory=/opt/xos/images
+dependency_graph=/opt/xos/model-deps
+logfile=/var/log/xos_backend.log
+
+[gui]
+disable_minidashboard=True
+#branding_name=CORD
+#branding_css=/static/cord.css
+#branding_icon=/static/onos-logo.png
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
index 0a1f04a..884c5da 100644
--- a/xos/configurations/frontend/Makefile
+++ b/xos/configurations/frontend/Makefile
@@ -8,6 +8,8 @@
frontend:
sudo apt-get -y install httpie
cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
+ cp ../common/xos_common_config ../../xos/xos_configuration/
+ cp ./xos_frontend_config ../../xos/xos_configuration/
cd ../../..; sudo docker build -t xos -f xos/configurations/frontend/Dockerfile .
sudo docker run -v $(XOS_FOLDER)/../../core/xoslib:/opt/xos/core/xoslib -p 9999:8000 --add-host="0.0.0.0:127.0.0.1" xos
bash ../common/wait_for_xos.sh
@@ -15,6 +17,8 @@
interactive:
cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
+ cp ../common/xos_common_config ../../xos/xos_configuration/
+ cp ./xos_frontend_config ../../xos/xos_configuration/
cd ../../..; sudo docker build -t xos -f xos/configurations/frontend/Dockerfile .
echo "Inside the container run: /usr/bin/make -C /opt/xos/configurations/frontend -f Makefile.inside"
sudo docker run -it -v $(shell pwd)/../..:/opt/xos -p 9999:8000 --add-host="0.0.0.0:127.0.0.1" xos
diff --git a/xos/configurations/frontend/xos_frontend_config b/xos/configurations/frontend/xos_frontend_config
new file mode 100644
index 0000000..13fe53b
--- /dev/null
+++ b/xos/configurations/frontend/xos_frontend_config
@@ -0,0 +1,4 @@
+[gui]
+branding_name=CORD
+branding_css=/static/cord.css
+branding_icon=/static/onos-logo.png
diff --git a/xos/xos/config.py b/xos/xos/config.py
index 83d69cb..c25b248 100644
--- a/xos/xos/config.py
+++ b/xos/xos/config.py
@@ -13,7 +13,7 @@
"""
XOS_DIR = "/opt/xos"
-DEFAULT_CONFIG_FN = os.path.join(XOS_DIR, "xos_config")
+DEFAULT_CONFIG_FN = os.path.join(XOS_DIR, "xos_configuration")
# warning for now, remove once we're sure everyone has made the change
if (os.path.exists("/opt/planetstack/plstackapi_config") and (not os.path.exists(DEFAULT_CONFIG_FN))):
@@ -80,7 +80,10 @@
def load(self, filename):
if filename:
try:
- self.config.read(filename)
+ if os.path.isdir(filename):
+ self.config.read(os.listdir(filename))
+ else:
+ self.config.read(filename)
except ConfigParser.MissingSectionHeaderError:
if filename.endswith('.xml'):
self.load_xml(filename)
diff --git a/xos/xos/xos_configuration/xos_common_config b/xos/xos/xos_configuration/xos_common_config
new file mode 100755
index 0000000..b86d618
--- /dev/null
+++ b/xos/xos/xos_configuration/xos_common_config
@@ -0,0 +1,45 @@
+[plc]
+name=plc
+deployment=plc
+
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+[api]
+host=localhost
+port=8000
+ssl_key=None
+ssl_cert=None
+ca_ssl_cert=None
+ratelimit_enabled=0
+omf_enabled=0
+mail_support_address=support@localhost
+nova_enabled=True
+logfile=/var/log/xos.log
+
+[nova]
+admin_user=admin@domain.com
+admin_password=admin
+admin_tenant=admin
+url=http://localhost:5000/v2.0/
+default_image=None
+default_flavor=m1.small
+default_security_group=default
+ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
+
+[observer]
+pretend=False
+backoff_disabled=False
+images_directory=/opt/xos/images
+dependency_graph=/opt/xos/model-deps
+logfile=/var/log/xos_backend.log
+
+[gui]
+disable_minidashboard=True
+#branding_name=CORD
+#branding_css=/static/cord.css
+#branding_icon=/static/onos-logo.png
diff --git a/xos/xos/xos_configuration/xos_frontend_config b/xos/xos/xos_configuration/xos_frontend_config
new file mode 100755
index 0000000..13fe53b
--- /dev/null
+++ b/xos/xos/xos_configuration/xos_frontend_config
@@ -0,0 +1,4 @@
+[gui]
+branding_name=CORD
+branding_css=/static/cord.css
+branding_icon=/static/onos-logo.png