diff --git a/scripts/clmc-service/install-tick-stack.sh b/scripts/clmc-service/install-tick-stack.sh index 74de3854ca772e1aef7c9b028ad62a8e4fcc387d..0f60ae39c6267f2f2873c987f0e11c67dcb182ac 100755 --- a/scripts/clmc-service/install-tick-stack.sh +++ b/scripts/clmc-service/install-tick-stack.sh @@ -58,7 +58,7 @@ done # define the TICK script templates within Kapacitor echo "----> Creating alert templates in Kapacitor" -cd ${REPO_ROOT}/src/service/clmcservice/resources/TICKscript +cd ${REPO_ROOT}/src/service/resources/TICKscript for template_file in *.tick; do template_id=$(basename ${template_file} .tick) echo ${template_id} ${template_file} diff --git a/src/service/MANIFEST.in b/src/service/MANIFEST.in index 2d2b4a86ce2829fcec8b7f3c17ed5f00270f5a39..250b3a92e4e0fa8a5608d979a649706671261c15 100644 --- a/src/service/MANIFEST.in +++ b/src/service/MANIFEST.in @@ -1,3 +1,6 @@ -include clmcservice/resources/tosca/flame_clmc_alerts_definitions.yaml -include clmcservice/VERSION -recursive-include clmcservice/resources/TICKscript *_template.tick \ No newline at end of file +include VERSION +include .coveragerc +include network_config.json +include *.ini +include clmcservice/flame_clmc_alerts_definitions.yaml +recursive-include resources/TICKscript *_template.tick \ No newline at end of file diff --git a/src/service/clmcservice/VERSION b/src/service/VERSION similarity index 100% rename from src/service/clmcservice/VERSION rename to src/service/VERSION diff --git a/src/service/clmcservice/alertsapi/tests.py b/src/service/clmcservice/alertsapi/tests.py index 556120f1bc8850a49bb480260aa64ce928199a8c..e5bf014a559975464aaaab4e41d4121771fbd377 100644 --- a/src/service/clmcservice/alertsapi/tests.py +++ b/src/service/clmcservice/alertsapi/tests.py @@ -25,7 +25,7 @@ # Python standard libs from os import listdir -from os.path import isfile, join +from os.path import isfile, join, dirname from urllib.parse import urlparse # PIP installed libs @@ -74,7 +74,7 @@ class TestAlertsConfigurationAPI(object): """ for path_suffix, valid_expected in (("valid", True), ("invalid", False)): - test_data_path = join(ROOT_DIR, *["resources", "tosca", "test-data", "tosca-parser", path_suffix]) + test_data_path = join(dirname(ROOT_DIR), *["resources", "tosca", "test-data", "tosca-parser", path_suffix]) for test_file_path in listdir(test_data_path): alert_config_abs_path = join(test_data_path, test_file_path) @@ -105,7 +105,7 @@ class TestAlertsConfigurationAPI(object): """ for path_suffix, valid_expected in (("valid", True), ("invalid", False)): - test_data_path = join(ROOT_DIR, *["resources", "tosca", "test-data", "clmc-validator", path_suffix]) + test_data_path = join(dirname(ROOT_DIR), *["resources", "tosca", "test-data", "clmc-validator", path_suffix]) for test_file_path in listdir(test_data_path): alert_config_abs_path = join(test_data_path, test_file_path) @@ -141,7 +141,7 @@ class TestAlertsConfigurationAPI(object): """ for test_folder in ("clmc-validator", "tosca-parser"): - test_data_path = join(ROOT_DIR, *["resources", "tosca", "test-data", test_folder, "valid"]) + test_data_path = join(dirname(ROOT_DIR), *["resources", "tosca", "test-data", test_folder, "valid"]) for test_file_path in listdir(test_data_path): alert_spec_abs_path = join(test_data_path, test_file_path) diff --git a/src/service/clmcservice/alertsapi/utilities.py b/src/service/clmcservice/alertsapi/utilities.py index 4bb0d2fd428c2ae69e69211efac8aa863efb4ea6..f741e5a61c52d66aba94aaec02f7c27c0267ccc9 100644 --- a/src/service/clmcservice/alertsapi/utilities.py +++ b/src/service/clmcservice/alertsapi/utilities.py @@ -30,7 +30,7 @@ from os.path import join from clmcservice import ROOT_DIR -CLMC_ALERTS_TOSCA_DEFINITIONS_REL_PATH = ["resources", "tosca", "flame_clmc_alerts_definitions.yaml"] +CLMC_ALERTS_TOSCA_DEFINITIONS_REL_PATH = ["flame_clmc_alerts_definitions.yaml"] CLMC_ALERTS_TOSCA_DEFINITIONS_ABS_PATH = join(ROOT_DIR, *CLMC_ALERTS_TOSCA_DEFINITIONS_REL_PATH) diff --git a/src/service/clmcservice/resources/tosca/flame_clmc_alerts_definitions.yaml b/src/service/clmcservice/flame_clmc_alerts_definitions.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/flame_clmc_alerts_definitions.yaml rename to src/service/clmcservice/flame_clmc_alerts_definitions.yaml diff --git a/src/service/clmcservice/resources/TICKscript/deadman-template.tick b/src/service/resources/TICKscript/deadman-template.tick similarity index 100% rename from src/service/clmcservice/resources/TICKscript/deadman-template.tick rename to src/service/resources/TICKscript/deadman-template.tick diff --git a/src/service/clmcservice/resources/TICKscript/relative-template.tick b/src/service/resources/TICKscript/relative-template.tick similarity index 100% rename from src/service/clmcservice/resources/TICKscript/relative-template.tick rename to src/service/resources/TICKscript/relative-template.tick diff --git a/src/service/clmcservice/resources/TICKscript/threshold-template.tick b/src/service/resources/TICKscript/threshold-template.tick similarity index 100% rename from src/service/clmcservice/resources/TICKscript/threshold-template.tick rename to src/service/resources/TICKscript/threshold-template.tick diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-1.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-1.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-1.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-1.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-10.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-10.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-10.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-10.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-2.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-2.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-2.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-2.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-3.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-3.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-3.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-3.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-4.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-4.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-4.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-4.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-5.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-5.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-5.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-5.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-6.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-6.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-6.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-6.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-7.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-7.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-7.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-7.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-8.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-8.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-8.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-8.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-9.yaml b/src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-9.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-9.yaml rename to src/service/resources/tosca/test-data/clmc-validator/invalid/alerts_test_config-9.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-1.yaml b/src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-1.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-1.yaml rename to src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-1.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-2.yaml b/src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-2.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-2.yaml rename to src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-2.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-3.yaml b/src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-3.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-3.yaml rename to src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-3.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-4.yaml b/src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-4.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-4.yaml rename to src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-4.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-5.yaml b/src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-5.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-5.yaml rename to src/service/resources/tosca/test-data/clmc-validator/valid/alerts_test_config-5.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-1.yaml b/src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-1.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-1.yaml rename to src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-1.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-2.yaml b/src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-2.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-2.yaml rename to src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-2.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-3.yaml b/src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-3.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-3.yaml rename to src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-3.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-4.yaml b/src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-4.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-4.yaml rename to src/service/resources/tosca/test-data/tosca-parser/invalid/alerts_test_config-4.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-1.yaml b/src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-1.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-1.yaml rename to src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-1.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-2.yaml b/src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-2.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-2.yaml rename to src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-2.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-3.yaml b/src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-3.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-3.yaml rename to src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-3.yaml diff --git a/src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-4.yaml b/src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-4.yaml similarity index 100% rename from src/service/clmcservice/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-4.yaml rename to src/service/resources/tosca/test-data/tosca-parser/valid/alerts_test_config-4.yaml diff --git a/src/service/setup.py b/src/service/setup.py index c020a6ea562c53df6ae6a406ba28c4eb05f164bb..5d966f515271706b94fa643595c734e799999e72 100644 --- a/src/service/setup.py +++ b/src/service/setup.py @@ -32,7 +32,7 @@ def get_version(*relative_path): """ Reads and parses a version file. - :param relative_path: iterable representing the relative path to the version file, e.g. ["clmcservice", "VERSION"] + :param relative_path: iterable representing the relative path to the version file :return: """ @@ -76,7 +76,7 @@ tests_require = [ setup( name="clmcservice", - version=get_version("clmcservice", "VERSION"), + version=get_version("VERSION"), author="Michael Boniface", author_email="mjb@it-innovation.soton.ac.uk", description="FLAME CLMC Service Module",