diff options
author | hariharan97 <rh20085046@wipro.com> | 2021-03-01 11:27:35 +0530 |
---|---|---|
committer | hariharan97 <rh20085046@wipro.com> | 2021-03-01 14:31:37 +0530 |
commit | cfaa7c1dd165be9eb9e7be251a9926dd7cd6f96c (patch) | |
tree | 710d0a2206b4aee8adae9e231da6e3d5f4ad0bb0 /conductor | |
parent | 7018c11d99ea69e8b48dbe1c9058c3ab4835da91 (diff) |
Update slice profile candidate to ignore coverage area if not present in service profile
Issue-ID: OPTFRA-923
Signed-off-by: hariharan97 <rh20085046@wipro.com>
Change-Id: Icb1e70ba60e7f3c26d931ad5c8158b66ffda93ab
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) |