diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 034253d..c4b2fe7 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -56,7 +56,7 @@ is up running:: Open your browser, and type the below address to start using it:: - http://127.0.0.1:8080/public/ui + http://127.0.0.1:8080/ui/index.html Running KloudBuster with CLI diff --git a/kb_server/kb_server/controllers/api_cfg.py b/kb_server/kb_server/controllers/api_cfg.py index 4b4b851..323efcf 100644 --- a/kb_server/kb_server/controllers/api_cfg.py +++ b/kb_server/kb_server/controllers/api_cfg.py @@ -52,7 +52,7 @@ class ConfigController(object): return wrapper - def update_config(self, kb_config, user_config): + def fix_config(self, kb_config, user_config): # Parsing server and client configs from application input # Save the public key into a temporary file if 'public_key' in user_config['kb_cfg']: @@ -161,7 +161,7 @@ class ConfigController(object): logging.setup("kloudbuster", logfile="/tmp/kb_log_%s" % session_id) kb_config.init_with_rest_api(cred_tested=cred_tested, cred_testing=cred_testing) - self.update_config(kb_config, user_config) + self.fix_config(kb_config, user_config) kb_session = KBSession() kb_session.kb_config = kb_config @@ -198,7 +198,7 @@ class ConfigController(object): # } try: kb_config = KBSessionManager.get(session_id).kb_config - self.update_config(kb_config, user_config) + self.fix_config(kb_config, user_config) except Exception: response.status = 400 response.text = u"Error while parsing configurations: \n%s" %\ diff --git a/kb_server/kb_server/controllers/api_kb.py b/kb_server/kb_server/controllers/api_kb.py index 6da62c8..b2a0c5d 100644 --- a/kb_server/kb_server/controllers/api_kb.py +++ b/kb_server/kb_server/controllers/api_kb.py @@ -63,6 +63,7 @@ class KBController(object): kb_config.server_cfg, kb_config.client_cfg, kb_config.topo_cfg, kb_config.tenants_list) if kb_session.kloudbuster.check_and_upload_images(): + kb_session.sync_cfg(["server_cfg", "client_cfg", "topo_cfg", "tenants_list"]) kb_session.kloudbuster.stage() kb_session.kb_status = 'STAGED' except Exception: @@ -74,9 +75,8 @@ class KBController(object): kb_session.kb_status = 'RUNNING' kloudbuster = kb_session.kloudbuster try: - kloudbuster.run_test( - config=kb_session.kb_config.client_cfg, - http_test_only=not kb_session.first_run) + kb_session.sync_cfg(["client_cfg"]) + kloudbuster.run_test(http_test_only=not kb_session.first_run) kb_session.first_run = False kb_session.kb_status = 'STAGED' except Exception: diff --git a/kb_server/kb_server/controllers/kb_session.py b/kb_server/kb_server/controllers/kb_session.py index 513ca4d..e24a953 100644 --- a/kb_server/kb_server/controllers/kb_session.py +++ b/kb_server/kb_server/controllers/kb_session.py @@ -52,3 +52,13 @@ class KBSession(object): self.first_run = True self.kb_config = None self.kloudbuster = None + + def sync_cfg(self, par_list): + if 'server_cfg' in par_list: + self.kloudbuster.server_cfg = self.kb_config.server_cfg + if 'client_cfg' in par_list: + self.kloudbuster.client_cfg = self.kb_config.client_cfg + if 'topo_cfg' in par_list and self.kb_config.topo_cfg: + self.kloudbuster.topology = self.kb_config.topo_cfg + if 'tenants_list' in par_list and self.kb_config.tenants_list: + self.kloudbuster.tenants_list = self.kb_config.tenants_list diff --git a/kb_server/public/dist/404.html b/kb_server/public/ui/404.html similarity index 100% rename from kb_server/public/dist/404.html rename to kb_server/public/ui/404.html diff --git a/kb_server/public/dist/favicon.ico b/kb_server/public/ui/favicon.ico similarity index 100% rename from kb_server/public/dist/favicon.ico rename to kb_server/public/ui/favicon.ico diff --git a/kb_server/public/dist/fonts/glyphicons-halflings-regular.eot b/kb_server/public/ui/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from kb_server/public/dist/fonts/glyphicons-halflings-regular.eot rename to kb_server/public/ui/fonts/glyphicons-halflings-regular.eot diff --git a/kb_server/public/dist/fonts/glyphicons-halflings-regular.svg b/kb_server/public/ui/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from kb_server/public/dist/fonts/glyphicons-halflings-regular.svg rename to kb_server/public/ui/fonts/glyphicons-halflings-regular.svg diff --git a/kb_server/public/dist/fonts/glyphicons-halflings-regular.ttf b/kb_server/public/ui/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from kb_server/public/dist/fonts/glyphicons-halflings-regular.ttf rename to kb_server/public/ui/fonts/glyphicons-halflings-regular.ttf diff --git a/kb_server/public/dist/fonts/glyphicons-halflings-regular.woff b/kb_server/public/ui/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from kb_server/public/dist/fonts/glyphicons-halflings-regular.woff rename to kb_server/public/ui/fonts/glyphicons-halflings-regular.woff diff --git a/kb_server/public/dist/fonts/glyphicons-halflings-regular.woff2 b/kb_server/public/ui/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from kb_server/public/dist/fonts/glyphicons-halflings-regular.woff2 rename to kb_server/public/ui/fonts/glyphicons-halflings-regular.woff2 diff --git a/kb_server/public/dist/images/back.8e3b7090.jpg b/kb_server/public/ui/images/back.8e3b7090.jpg similarity index 100% rename from kb_server/public/dist/images/back.8e3b7090.jpg rename to kb_server/public/ui/images/back.8e3b7090.jpg diff --git a/kb_server/public/dist/images/logo.d2085010.jpg b/kb_server/public/ui/images/logo.d2085010.jpg similarity index 100% rename from kb_server/public/dist/images/logo.d2085010.jpg rename to kb_server/public/ui/images/logo.d2085010.jpg diff --git a/kb_server/public/dist/index.html b/kb_server/public/ui/index.html similarity index 100% rename from kb_server/public/dist/index.html rename to kb_server/public/ui/index.html diff --git a/kb_server/public/dist/robots.txt b/kb_server/public/ui/robots.txt similarity index 100% rename from kb_server/public/dist/robots.txt rename to kb_server/public/ui/robots.txt diff --git a/kb_server/public/dist/scripts/scripts.34778082.js b/kb_server/public/ui/scripts/scripts.34778082.js similarity index 100% rename from kb_server/public/dist/scripts/scripts.34778082.js rename to kb_server/public/ui/scripts/scripts.34778082.js diff --git a/kb_server/public/dist/scripts/vendor.dec5bb28.js b/kb_server/public/ui/scripts/vendor.dec5bb28.js similarity index 100% rename from kb_server/public/dist/scripts/vendor.dec5bb28.js rename to kb_server/public/ui/scripts/vendor.dec5bb28.js diff --git a/kb_server/public/dist/styles/main.3300b539.css b/kb_server/public/ui/styles/main.3300b539.css similarity index 100% rename from kb_server/public/dist/styles/main.3300b539.css rename to kb_server/public/ui/styles/main.3300b539.css diff --git a/kb_server/public/dist/styles/vendor.3c59f993.css b/kb_server/public/ui/styles/vendor.3c59f993.css similarity index 100% rename from kb_server/public/dist/styles/vendor.3c59f993.css rename to kb_server/public/ui/styles/vendor.3c59f993.css diff --git a/kb_server/public/ui/test.html b/kb_server/public/ui/test.html deleted file mode 100644 index c2ddcc1..0000000 --- a/kb_server/public/ui/test.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Test - - -

Test

- - diff --git a/kloudbuster/kloudbuster.py b/kloudbuster/kloudbuster.py index 9d2a989..1c15ca4 100755 --- a/kloudbuster/kloudbuster.py +++ b/kloudbuster/kloudbuster.py @@ -447,10 +447,9 @@ class KloudBuster(object): # Function that print all the provisioning info self.print_provision_info() - def run_test(self, config=None, http_test_only=False): + def run_test(self, http_test_only=False): self.final_result = [] - if config: - self.kb_runner.config = config + self.kb_runner.config = self.client_cfg # Run the runner to perform benchmarkings for run_result in self.kb_runner.run(http_test_only): self.final_result.append(self.kb_runner.tool_result)