diff options
Diffstat (limited to 'conductor')
-rw-r--r-- | conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py | 3 | ||||
-rw-r--r-- | conductor/conductor/data/plugins/inventory_provider/generator.py | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py b/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py index 83ca4d7..a8f0b47 100644 --- a/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py +++ b/conductor/conductor/data/plugins/inventory_provider/candidates/slice_profiles_candidate.py @@ -57,7 +57,8 @@ class SliceProfilesCandidate(Candidate): else: self.slice_requirements = None self.other = kwargs["default_fields"] - self.coverage_area = kwargs["coverage_area"] + if "coverage_area" in kwargs: + self.coverage_area = kwargs["coverage_area"] def convert_nested_dict_to_dict(self): nested_dict = self.__dict__ diff --git a/conductor/conductor/data/plugins/inventory_provider/generator.py b/conductor/conductor/data/plugins/inventory_provider/generator.py index 4664347..0851cfa 100644 --- a/conductor/conductor/data/plugins/inventory_provider/generator.py +++ b/conductor/conductor/data/plugins/inventory_provider/generator.py @@ -108,9 +108,14 @@ class Generator(base.InventoryProviderBase): if is_valid(get_slice_requirements(combination), filtering_attributes['service_profile']): info = Candidate.build_candidate_info(self.name(), inventory_type, 1.0, candidate_uniqueness, str(uuid.uuid4())) - coverage_area = filtering_attributes['service_profile'].get("coverage_area").get("value") - candidate = SliceProfilesCandidate(info=info, subnet_requirements=combination, - default_fields=default_fields, coverage_area=coverage_area) + service_profile_attr = filtering_attributes['service_profile'] + if "coverage_area" in service_profile_attr: + coverage_area = filtering_attributes['service_profile'].get("coverage_area").get("value") + candidate = SliceProfilesCandidate(info=info, subnet_requirements=combination, + default_fields=default_fields, coverage_area=coverage_area) + else: + candidate = SliceProfilesCandidate(info=info, subnet_requirements=combination, + default_fields=default_fields) converted_candidate = candidate.convert_nested_dict_to_dict() candidates.append(converted_candidate) |