diff options
-rw-r--r-- | reg2pegasus.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/reg2pegasus.py b/reg2pegasus.py index 08f8662..8f77434 100644 --- a/reg2pegasus.py +++ b/reg2pegasus.py @@ -4,7 +4,7 @@ import sys import re reg_parse = re.compile(r"\[([^\]]+)\]\s+" -"provider: (\w+)\s+" +"provider: ([^\s]+)\s+" "location: (\w+)\s+" "type: ([^\n]+)\s+" "namespace: ([^\n]+)") @@ -38,17 +38,17 @@ def getTypes(types): l.append(value) return ",".join(l) -def define_capability(location, cls, types): +def define_capability(location, provider, cls, types): return """instance of PG_Provider { - Name = "%(class)s"; + Name = "%(provider)s"; ProviderModuleName = "%(location)s"; }; instance of PG_ProviderCapabilities { ProviderModuleName = "%(location)s"; - ProviderName = "%(class)s"; + ProviderName = "%(provider)s"; CapabilityID = "%(class)s"; ClassName = "%(class)s"; Namespaces = { "root/cimv2" }; @@ -56,7 +56,7 @@ instance of PG_ProviderCapabilities SupportedProperties = NULL; SupportedMethods = NULL; }; -""" % { 'location': location, 'class': cls, 'types': getTypes(types) } +""" % { 'location': location, 'provider': provider, 'class': cls, 'types': getTypes(types) } modules_defined = {} for record in reg_parse.findall(sys.stdin.read()): @@ -66,4 +66,4 @@ for record in reg_parse.findall(sys.stdin.read()): print define_module(location) modules_defined[location] = True - print define_capability(location, cls, types) + print define_capability(location, provider, cls, types) |