6 import sdcBePy.common.logger as logger
7 from sdcBePy.common.normative.main import process_element_list, process_type_list
8 from sdcBePy.common.sdcBeProxy import SdcBeProxy
9 from sdcBePy.tosca.main import get_args, usage
10 from sdcBePy.tosca.models.normativeElementsList import get_normative_element_candidate_list, \
11 get_normative_element_with_metadata_list
12 from sdcBePy.tosca.models.normativeTypesList import get_normative_type_candidate_list
16 scheme, be_host, be_port, admin_user, update_version, debug = get_args()
19 print('Disabling debug mode')
20 logger.debugFlag = debug
23 sdc_be_proxy = SdcBeProxy(be_host, be_port, scheme, admin_user, debug)
24 except AttributeError:
28 # use to run script form this dir (not like the command)
29 # base_file_location = os.getcwd() + "/../../../../import/tosca/"
30 base_file_location = os.getcwd() + os.path.sep
31 logger.debug("working directory =" + base_file_location)
33 process_element_list(get_normative_element_candidate_list(base_file_location), sdc_be_proxy)
34 process_type_list(get_normative_type_candidate_list(base_file_location), sdc_be_proxy, update_version)
35 process_element_list(get_normative_element_with_metadata_list(base_file_location), sdc_be_proxy)
37 logger.log("Script end ->", "All normatives imported successfully!")
38 logger.error_and_exit(0, None)
41 if __name__ == "__main__":