sdbus++: property: simplify local enum handling

Local enums are prepended with "self." in the YAML files,
which was propagated through some of the internal handling,
such as cppTypeName.  Eliminate this so that cppTypeName is
a real type for local enums.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I14424532a0bb392f050ce43d1b98996f94da5cd5
diff --git a/tools/sdbusplus/property.py b/tools/sdbusplus/property.py
index 5dd8d08..4349186 100644
--- a/tools/sdbusplus/property.py
+++ b/tools/sdbusplus/property.py
@@ -31,17 +31,15 @@
         Currently only 'enum' requires conversion.
     """
     def cppTypeParam(self, interface, server=True):
-        if self.is_enum():
-            r = self.cppTypeName
-            # self. means local type.
-            if r.startswith("self."):
-                return r.split('self.')[1]
+        r = self.cppTypeName
 
-            r = r.split('.')
-            r.insert(-2, "server" if server else "client")
-            r = "::".join(r)
-            return r
-        return self.cppTypeName
+        if self.is_enum():
+            if "." in r:
+                r = r.split('.')
+                r.insert(-2, "server" if server else "client")
+                r = "::".join(r)
+
+        return r
 
     """ Return a conversion of the cppTypeName valid as it is read out of a
         message.  Currently only 'enum' requires conversion.
@@ -158,7 +156,12 @@
         if result == 'enum':
             if top_type:
                 self.enum = True
-            return rest[0][0]
+            result = rest[0][0]
+
+            # self. means local type.
+            if result.startswith("self."):
+                return result[5:]   # "self." is 5 characters
+            return result
 
         # Parse each parameter entry, if appropriate, and create C++ template
         # syntax.