Fix VES event fields 38/84238/1
authorRehanRaza <muhammad.rehan.raza@est.tech>
Thu, 4 Apr 2019 12:42:15 +0000 (12:42 +0000)
committerRehanRaza <muhammad.rehan.raza@est.tech>
Thu, 4 Apr 2019 12:42:15 +0000 (12:42 +0000)
* timeZoneOffset uses default system timezone
* sourceName and reportingEntityName use the nodename of pnf-sim instance

Change-Id: Idf7f0b8d4a02cb533e81bdf69d5034cd842c3fb8
Issue-ID: DCAEGEN2-1225
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
test/mocks/mass-pnf-sim/pnf-sim-lightweight/config/netconf.env
test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml
test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh
test/mocks/mass-pnf-sim/pnf-sim-lightweight/src/main/java/org/onap/pnfsimulator/message/JSONObjectFactory.java

index c4f7b4a..ef79365 100644 (file)
@@ -8,4 +8,3 @@ NETCONF_ADDRESS=localhost
 NETCONF_PORT=830
 NETCONF_MODEL=pnf-simulator
 NETCONF_MAIN_CONTAINER=config
-TZ=Europe/Warsaw
index aa0261c..2c9226a 100644 (file)
@@ -19,6 +19,8 @@ services:
       - ./json_schema:/json_schema
       - ./config/config.yml:/config/config.yml:rw
       - ./files/:/files/:rw
+    environment:
+      TZ: "${TIMEZONE}"
     env_file:
       - ./config/netconf.env
     restart: on-failure
index 4c5d9f0..6ba7079 100755 (executable)
@@ -74,6 +74,8 @@ function compose(){
        export PORTFTPS=$8
        export IPFTPS=$9
        export IPSFTP=${10}
+       LOCALTIME=$(ls -l /etc/localtime)
+       export TIMEZONE=${LOCALTIME//*zoneinfo\/}
 
        #will insert $I to distinguish containers, networks properly
        #docker compose cannot substitute these, as they are keys, not values.
index 545a568..ded9910 100644 (file)
@@ -70,7 +70,7 @@ final class JSONObjectFactory {
         commonEventHeader.put(INTERNAL_HEADER_FIELDS, new JSONObject());
         commonEventHeader.put(VERSION, VERSION_NUMBER);
         commonEventHeader.put(VES_EVENT_LISTENER_VERSION, VES_EVENT_LISTENER_VERSION_NUMBER);
-        String absPath = System.getProperty("user.dir");
+        String absPath = new File("").getAbsolutePath();
         String nodeName = absPath.substring(absPath.lastIndexOf(File.separator)+1);
         commonEventHeader.put(SOURCE_NAME, nodeName);
         commonEventHeader.put(REPORTING_ENTITY_NAME, nodeName);