Merge "[DCAEGEN2] PMSH Update to Support Helm Transformation"
diff --git a/components/pm-subscription-handler/Changelog.md b/components/pm-subscription-handler/Changelog.md
index 9190007..be2a7a7 100755
--- a/components/pm-subscription-handler/Changelog.md
+++ b/components/pm-subscription-handler/Changelog.md
@@ -6,6 +6,14 @@
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
 
+## [1.3.1]
+### Changed
+* Updated Subscription object retrieving key from App Config data (DCAEGEN2-2713)
+
+## [1.3.0]
+### Changed
+* Change pmsh baseOS img to integration (DCAEGEN2-2420)
+
 ## [1.2.0]
 ### Changed
 * Bug fix prevent sub threads from crashing permanently (DCAEGEN2-2501)
diff --git a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
index a5fc86e..9ddff31 100755
--- a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
@@ -88,7 +88,7 @@
         self.operational_policy_name = conf['config'].get('operational_policy_name')
         self.control_loop_name = conf['config'].get('control_loop_name')
         self.sub_schema = _load_sub_schema_from_file()
-        self.subscription = Subscription(**conf['policy']['subscription'])
+        self.subscription = Subscription(**conf['config']['pmsh_policy']['subscription'])
         self.nf_filter = None
 
     def __new__(cls, *args, **kwargs):
@@ -141,7 +141,7 @@
         """
         try:
             app_conf = self._get_pmsh_config()
-            self.subscription = Subscription(**app_conf['policy']['subscription'])
+            self.subscription = Subscription(**app_conf['config']['pmsh_policy']['subscription'])
             logger.info("AppConfig data has been refreshed")
         except Exception:
             logger.error('Failed to refresh PMSH AppConfig')
diff --git a/components/pm-subscription-handler/pom.xml b/components/pm-subscription-handler/pom.xml
index d4f7eaf..fbf4497 100644
--- a/components/pm-subscription-handler/pom.xml
+++ b/components/pm-subscription-handler/pom.xml
@@ -32,7 +32,7 @@
   <groupId>org.onap.dcaegen2.services</groupId>
   <artifactId>pmsh</artifactId>
   <name>dcaegen2-services-pm-subscription-handler</name>
-  <version>1.3.0-SNAPSHOT</version>
+  <version>1.3.1-SNAPSHOT</version>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <sonar.sources>.</sonar.sources>
diff --git a/components/pm-subscription-handler/setup.py b/components/pm-subscription-handler/setup.py
index 6a2ef24..e4d3133 100644
--- a/components/pm-subscription-handler/setup.py
+++ b/components/pm-subscription-handler/setup.py
@@ -21,7 +21,7 @@
 
 setup(
     name="pm_subscription_handler",
-    version="1.2.0",
+    version="1.3.1",
     packages=find_packages(),
     author="lego@est.tech",
     author_email="lego@est.tech",
diff --git a/components/pm-subscription-handler/tests/data/cbs_data_1.json b/components/pm-subscription-handler/tests/data/cbs_data_1.json
index 2e405d0..f872bb5 100644
--- a/components/pm-subscription-handler/tests/data/cbs_data_1.json
+++ b/components/pm-subscription-handler/tests/data/cbs_data_1.json
@@ -1,78 +1,78 @@
 {
-   "policy":{
-      "subscription":{
-         "subscriptionName":"ExtraPM-All-gNB-R2B",
-         "administrativeState":"UNLOCKED",
-         "fileBasedGP":15,
-         "fileLocation":"\/pm\/pm.xml",
-         "nfFilter":{
-            "nfNames":[
-               "^pnf.*",
-               "^vnf.*"
-            ],
-            "modelInvariantIDs": [
-
-            ],
-            "modelVersionIDs": [
-
-            ],
-            "modelNames": [
-
-            ]
-         },
-         "measurementGroups":[
-            {
-               "measurementGroup":{
-                  "measurementTypes":[
-                     {
-                        "measurementType":"countera"
-                     },
-                     {
-                        "measurementType":"counterb"
-                     }
-                  ],
-                  "managedObjectDNsBasic":[
-                     {
-                        "DN":"dna"
-                     },
-                     {
-                        "DN":"dnb"
-                     }
-                  ]
-               }
-            },
-            {
-               "measurementGroup":{
-                  "measurementTypes":[
-                     {
-                        "measurementType":"counterc"
-                     },
-                     {
-                        "measurementType":"counterd"
-                     }
-                  ],
-                  "managedObjectDNsBasic":[
-                     {
-                        "DN":"dnc"
-                     },
-                     {
-                        "DN":"dnd"
-                     }
-                  ]
-               }
-            }
-         ]
-      }
-   },
    "config":{
-      "control_loop_name": "pmsh-control-loop",
-      "operational_policy_name": "pmsh-operational-policy",
+      "control_loop_name":"pmsh-control-loop",
+      "operational_policy_name":"pmsh-operational-policy",
       "aaf_password":"demo123456!",
       "aaf_identity":"dcae@dcae.onap.org",
       "cert_path":"/opt/app/pmsh/etc/certs/cert.pem",
       "key_path":"/opt/app/pmsh/etc/certs/key.pem",
       "ca_cert_path":"/opt/app/pmsh/etc/certs/cacert.pem",
       "enable_tls":"true",
+      "pmsh_policy":{
+         "subscription":{
+            "subscriptionName":"ExtraPM-All-gNB-R2B",
+            "administrativeState":"UNLOCKED",
+            "fileBasedGP":15,
+            "fileLocation":"\/pm\/pm.xml",
+            "nfFilter":{
+               "nfNames":[
+                  "^pnf.*",
+                  "^vnf.*"
+               ],
+               "modelInvariantIDs":[
+
+               ],
+               "modelVersionIDs":[
+
+               ],
+               "modelNames":[
+
+               ]
+            },
+            "measurementGroups":[
+               {
+                  "measurementGroup":{
+                     "measurementTypes":[
+                        {
+                           "measurementType":"countera"
+                        },
+                        {
+                           "measurementType":"counterb"
+                        }
+                     ],
+                     "managedObjectDNsBasic":[
+                        {
+                           "DN":"dna"
+                        },
+                        {
+                           "DN":"dnb"
+                        }
+                     ]
+                  }
+               },
+               {
+                  "measurementGroup":{
+                     "measurementTypes":[
+                        {
+                           "measurementType":"counterc"
+                        },
+                        {
+                           "measurementType":"counterd"
+                        }
+                     ],
+                     "managedObjectDNsBasic":[
+                        {
+                           "DN":"dnc"
+                        },
+                        {
+                           "DN":"dnd"
+                        }
+                     ]
+                  }
+               }
+            ]
+         }
+      },
       "streams_subscribes":{
          "aai_subscriber":{
             "type":"message_router",
diff --git a/components/pm-subscription-handler/tests/data/cbs_invalid_data.json b/components/pm-subscription-handler/tests/data/cbs_invalid_data.json
index 92da2b9..a6f6368 100644
--- a/components/pm-subscription-handler/tests/data/cbs_invalid_data.json
+++ b/components/pm-subscription-handler/tests/data/cbs_invalid_data.json
@@ -1,77 +1,77 @@
 {
-   "policy":{
-      "subscription":{
-         "subscriptionName":"ExtraPM-All-gNB-R2B",
-         "administrativeState":"UNLOCKED",
-         "fileBasedGP":15,
-         "fileLocation":"\/pm\/pm.xml",
-         "nfFilter":{
-            "nfNames":[
-
-            ],
-            "modelInvariantIDs": [
-
-            ],
-            "modelVersionIDs": [
-
-            ],
-            "modelNames": [
-
-            ]
-         },
-         "measurementGroups":[
-            {
-               "measurementGroup":{
-                  "measurementTypes":[
-                     {
-                        "measurementType":"countera"
-                     },
-                     {
-                        "measurementType":"counterb"
-                     }
-                  ],
-                  "managedObjectDNsBasic":[
-                     {
-                        "DN":"dna"
-                     },
-                     {
-                        "DN":"dnb"
-                     }
-                  ]
-               }
-            },
-            {
-               "measurementGroup":{
-                  "measurementTypes":[
-                     {
-                        "measurementType":"counterc"
-                     },
-                     {
-                        "measurementType":"counterd"
-                     }
-                  ],
-                  "managedObjectDNsBasic":[
-                     {
-                        "DN":"dnc"
-                     },
-                     {
-                        "DN":"dnd"
-                     }
-                  ]
-               }
-            }
-         ]
-      }
-   },
    "config":{
-      "control_loop_name": "pmsh-control-loop",
-      "operational_policy_name": "pmsh-operational-policy",
+      "control_loop_name":"pmsh-control-loop",
+      "operational_policy_name":"pmsh-operational-policy",
       "aaf_password":"demo123456!",
       "aaf_identity":"dcae@dcae.onap.org",
       "cert_path":"/opt/app/pmsh/etc/certs/cert.pem",
       "key_path":"/opt/app/pmsh/etc/certs/key.pem",
       "ca_cert_path":"/opt/app/pmsh/etc/certs/cacert.pem",
       "enable_tls":"true",
+      "pmsh_policy":{
+         "subscription":{
+            "subscriptionName":"ExtraPM-All-gNB-R2B",
+            "administrativeState":"UNLOCKED",
+            "fileBasedGP":15,
+            "fileLocation":"\/pm\/pm.xml",
+            "nfFilter":{
+               "nfNames":[
+
+               ],
+               "modelInvariantIDs":[
+
+               ],
+               "modelVersionIDs":[
+
+               ],
+               "modelNames":[
+
+               ]
+            },
+            "measurementGroups":[
+               {
+                  "measurementGroup":{
+                     "measurementTypes":[
+                        {
+                           "measurementType":"countera"
+                        },
+                        {
+                           "measurementType":"counterb"
+                        }
+                     ],
+                     "managedObjectDNsBasic":[
+                        {
+                           "DN":"dna"
+                        },
+                        {
+                           "DN":"dnb"
+                        }
+                     ]
+                  }
+               },
+               {
+                  "measurementGroup":{
+                     "measurementTypes":[
+                        {
+                           "measurementType":"counterc"
+                        },
+                        {
+                           "measurementType":"counterd"
+                        }
+                     ],
+                     "managedObjectDNsBasic":[
+                        {
+                           "DN":"dnc"
+                        },
+                        {
+                           "DN":"dnd"
+                        }
+                     ]
+                  }
+               }
+            ]
+         }
+      },
       "streams_subscribes":{
          "aai_subscriber":{
             "type":"message_router",
diff --git a/components/pm-subscription-handler/version.properties b/components/pm-subscription-handler/version.properties
index 7d6815b..fee4928 100644
--- a/components/pm-subscription-handler/version.properties
+++ b/components/pm-subscription-handler/version.properties
@@ -1,6 +1,6 @@
 major=1
 minor=3
-patch=0
+patch=1
 base_version=${major}.${minor}.${patch}
 release_version=${base_version}
 snapshot_version=${base_version}-SNAPSHOT