Remove lower case conversion of subnet 18/114718/2
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Mon, 9 Nov 2020 14:26:19 +0000 (19:56 +0530)
committerkrishnaa96 <krishna.moorthy6@wipro.com>
Tue, 10 Nov 2020 04:41:31 +0000 (10:11 +0530)
- Subnet type is being converted to lower case
  before sending the request to HAS which creates
  problems while sending the solution back to SO
- Fix typo in the response(slice_profiles)

Issue-ID: OPTFRA-870
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: I4e2d8d28a16e90087a7fcc71c302ebd95833e8fc

apps/slice_selection/optimizers/conductor/remote_opt_processor.py
apps/slice_selection/optimizers/conductor/response_processor.py
test/apps/slice_selection/new_solution_nsi_response.json

index 432655b..0fbf36e 100644 (file)
@@ -114,7 +114,7 @@ class SliceSelectionOptimizer(Thread):
         subnet_capabilities = self.request_json.get('subnetCapabilities')
         if subnet_capabilities:
             for subnet_capability in subnet_capabilities:
-                domain_type = f"{subnet_capability['domainType'].lower().replace('-', '_')}_"
+                domain_type = f"{subnet_capability['domainType']}_"
                 capability_details = subnet_capability['capabilityDetails']
                 for key, value in capability_details.items():
                     request_params[f"{domain_type}{camel_to_snake[key]}"] = value
index 71a350f..d2c949b 100644 (file)
@@ -67,7 +67,7 @@ class ResponseProcessor(object):
             return {
                 'existingNSI': False,
                 'newNSISolution': {
-                    'slice_profiles': self.get_slice_profiles_from_candidate(candidate, subnets)
+                    'sliceProfiles': self.get_slice_profiles_from_candidate(candidate, subnets)
                 }
             }
 
index 2ecb543..3fbeffe 100644 (file)
@@ -7,7 +7,7 @@
       {
          "existingNSI": false,
          "newNSISolution": {
-            "slice_profiles": [
+            "sliceProfiles": [
                {
                   "domainType": "AN",
                   "resourceSharingLevel": "shared",
@@ -32,4 +32,4 @@
          }
       }
    ]
-}
\ No newline at end of file
+}