Merge "Disable selinux for RHEL"
[releng.git] / utils / test / dashboard / dashboard / conf / config.py
index 143b193..6114e90 100644 (file)
@@ -1,5 +1,6 @@
 #! /usr/bin/env python
 
+import urlparse
 from ConfigParser import SafeConfigParser, NoOptionError
 
 
@@ -22,12 +23,12 @@ class APIConfig:
     """
 
     def __init__(self):
-        self._default_config_location = "../etc/config.ini"
+        self._default_config_location = "/etc/dashboard/config.ini"
         self.es_url = 'http://localhost:9200'
         self.es_creds = None
         self.kibana_url = None
-        self.is_js = True
         self.js_path = None
+        self.index_url = None
 
     def _get_str_parameter(self, section, param):
         try:
@@ -67,8 +68,9 @@ class APIConfig:
         obj.es_url = obj._get_str_parameter("elastic", "url")
         obj.es_creds = obj._get_str_parameter("elastic", "creds")
         obj.kibana_url = obj._get_str_parameter("kibana", "url")
-        obj.is_js = obj._get_bool_parameter("kibana", "js")
         obj.js_path = obj._get_str_parameter("kibana", "js_path")
+        index = obj._get_str_parameter("elastic", "index")
+        obj.index_url = urlparse.urljoin(obj.es_url, index)
 
         return obj
 
@@ -76,9 +78,9 @@ class APIConfig:
         return "elastic_url = %s \n" \
                "elastic_creds = %s \n" \
                "kibana_url = %s \n" \
-               "is_js = %s \n" \
+               "index_url = %s \n" \
                "js_path = %s \n" % (self.es_url,
                                     self.es_creds,
                                     self.kibana_url,
-                                    self.is_js,
+                                    self.index_url,
                                     self.js_path)