Add chassis association to sensors

Add an association to the chassis for each sensor so that the Redfish
code can find them.  The forward association is 'chassis', and the
reverse association is 'all_sensors'.  This matches what other sensor
applications do and is documented in sensors-architecture.md in the docs
repository.

Tested: Checked the associations were present in the mapper and that the
sensors now show up on the sensors page in the web UI.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iefb6d4dc2e5c9399d919e9e1b7c8dd04f20e7a3e
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 304a764..ea2020c 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -399,6 +399,13 @@
             continue;
         }
 
+        // At this point, the sensor will be created for sure.
+        if (existingSensors.find(sensorPath) == existingSensors.end())
+        {
+            open_power::occ::dbus::OccDBusSensors::getOccDBus()
+                .setChassisAssociation(sensorPath);
+        }
+
         if (faultValue != 0)
         {
             open_power::occ::dbus::OccDBusSensors::getOccDBus().setValue(
@@ -528,6 +535,12 @@
         open_power::occ::dbus::OccDBusSensors::getOccDBus()
             .setOperationalStatus(sensorPath, true);
 
+        if (existingSensors.find(sensorPath) == existingSensors.end())
+        {
+            open_power::occ::dbus::OccDBusSensors::getOccDBus()
+                .setChassisAssociation(sensorPath);
+        }
+
         existingSensors[sensorPath] = id;
     }
     return;