def __process_subprojects(subprojects, vnfcs, default_rm_type, params_by_project): subproject_requests = [] rm = None for subproject in subprojects: project_type_ref, name = subproject if '::' in project_type_ref: ref_split = project_type_ref.split('::', 1) project_type = ref_split[0] rm = ref_split[1] else: project_type = project_type_ref request = __build_subproject_request_for_type(project_type) request.name = name request.directory = files.safe_file_name(name) if isinstance(request, creator.ResourceSubprojectRequest): if not rm: rm = default_rm_type request.resource_manager = rm request.params = params_by_project.get(name, {}) subproject_requests.append(request) for vnfc in vnfcs: request = creator.ResourceSubprojectRequest() request.directory = files.safe_file_name(vnfc) request.resource_manager = creator.ANSIBLE_RM_TYPES[0] request.name = vnfc request.params = params_by_project.get(vnfc, {}) subproject_requests.append(request) return subproject_requests
def gen_service_behaviour_configuration_path(self, configuration_name): safe_file_name = '{0}.json'.format( files.safe_file_name(configuration_name)) return self.resolve_relative_path( self.service_behaviour_name, AssemblySourceTree.BEHAVIOUR_CONFIGURATIONS_DIR_NAME, safe_file_name)
def gen_service_behaviour_tests_path(self, test_name): safe_file_name = '{0}.json'.format(files.safe_file_name(test_name)) return self.resolve_relative_path( self.service_behaviour_name, TypeSourceTree.BEHAVIOUR_TESTS_DIR_NAME, safe_file_name)
def gen_service_behaviour_runtime_path(self, runtime_name): safe_file_name = '{0}.json'.format(files.safe_file_name(runtime_name)) return self.resolve_relative_path( self.service_behaviour_name, AssemblySourceTree.BEHAVIOUR_RUNTIME_DIR_NAME, safe_file_name)