Fix an issue with $index

the $index replacement for names wasn't working correctly.  This commit
refactors the code to make it work correctly in 3 cases.

1. Where the template is the entire string "$index" replaces it with the
given type.
2. Where the template is a portion of the string "index=$index" in which
case it replaces just the parameter with the stringified version.
3. Where the template starts with 0x, which replaces it with the hex
equivalent.

Tested By:
Observed PCIe retimer device is called "retimer 0" instead of "retimer
_"

Change-Id: I37a22f1c5502057754eb0d89c467502eb054d73b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/configurations/A2UX8X4RISER.json b/configurations/A2UX8X4RISER.json
new file mode 100644
index 0000000..e960f87
--- /dev/null
+++ b/configurations/A2UX8X4RISER.json
@@ -0,0 +1,53 @@
+[
+    {
+        "Exposes": [
+            {
+                "Address": "0x4E",
+                "Bus": "$bus",
+                "Name": "Riser 3 Temp",
+                "Thresholds": [
+                    {
+                        "Direction": "greater than",
+                        "Name": "upper critical",
+                        "Severity": 1,
+                        "Value": 80
+                    },
+                    {
+                        "Direction": "greater than",
+                        "Name": "upper non critical",
+                        "Severity": 0,
+                        "Value": 75
+                    },
+                    {
+                        "Direction": "less than",
+                        "Name": "lower non critical",
+                        "Severity": 0,
+                        "Value": 5
+                    },
+                    {
+                        "Direction": "less than",
+                        "Name": "lower critical",
+                        "Severity": 1,
+                        "Value": 0
+                    }
+                ],
+                "Type": "TMP75"
+            },
+            {
+                "Address": "$address",
+                "Bus": "$bus",
+                "Name": "Riser 3 Fru",
+                "Type": "EEPROM"
+            }
+        ],
+        "Name": "2Ux8 Riser 3",
+        "Type": "Board",
+        "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'A2UX8X4RISER'})",
+        "xyz.openbmc_project.Inventory.Decorator.Asset": {
+            "Manufacturer": "$BOARD_MANUFACTURER",
+            "Model": "$BOARD_PRODUCT_NAME",
+            "PartNumber": "$BOARD_PART_NUMBER",
+            "SerialNumber": "$BOARD_SERIAL_NUMBER"
+        }
+    }
+]
\ No newline at end of file