| 
     
      
      
      From: <ba...@us...> - 2008-02-14 03:50:03
      
     
   | 
Revision: 536
          http://omc.svn.sourceforge.net/omc/?rev=536&view=rev
Author:   bartw
Date:     2008-02-13 19:50:09 -0800 (Wed, 13 Feb 2008)
Log Message:
-----------
fixed FileIdentity assoc. to not require all of the keys of the target object
Modified Paths:
--------------
    pybase/trunk/OMC_LogicalFile.py
Modified: pybase/trunk/OMC_LogicalFile.py
===================================================================
--- pybase/trunk/OMC_LogicalFile.py	2008-02-13 20:18:47 UTC (rev 535)
+++ pybase/trunk/OMC_LogicalFile.py	2008-02-14 03:50:09 UTC (rev 536)
@@ -713,29 +713,39 @@
 
         if object_name.classname.lower() == 'omc_linuxfile':
             model['SameElement'] = object_name
+            try:
+                keybindings = {
+                    'Name':object_name['LFName'],
+                    'FSName':object_name['FSName'],
+                    'FSCreationClassName':object_name['FSCreationClassName'],
+                    'CSName':getfqdn(),
+                    'CSCreationClassName':object_name['CSCreationClassName'],
+                    'CreationClassName':object_name['LFCreationClassName']}
+            except KeyError:
+                keybindings = {}
+                get_file_keys(object_name['LFname'], keybindings)
             model['SystemElement'] = pywbem.CIMInstanceName(
                     classname=object_name['LFCreationClassName'],
                     namespace=object_name.namespace,
-                    keybindings={
-                        'Name':object_name['LFName'],
-                        'FSName':object_name['FSName'],
-                        'FSCreationClassName':object_name['FSCreationClassName'],
-                        'CSName':getfqdn(),
-                        'CSCreationClassName':object_name['CSCreationClassName'],
-                        'CreationClassName':object_name['LFCreationClassName']})
+                    keybindings=keybindings)
             yield model
         else:
             model['SystemElement'] = object_name
-            model['SameElement'] = pywbem.CIMInstanceName(
-                    classname='OMC_LinuxFile',
-                    namespace=object_name.namespace,
-                    keybindings={
+            try:
+                keybindings = {
                         'LFName':object_name['Name'],
                         'FSName':object_name['FSName'],
                         'FSCreationClassName':object_name['FSCreationClassName'],
                         'CSName':getfqdn(),
                         'CSCreationClassName':object_name['CSCreationClassName'],
-                        'LFCreationClassName':object_name['CreationClassName']})
+                        'LFCreationClassName':object_name['CreationClassName']}
+            except KeyError:
+                keybindings = {}
+                get_file_keys(object_name['Name'], keybindings, linux_file=True)
+            model['SameElement'] = pywbem.CIMInstanceName(
+                    classname='OMC_LinuxFile',
+                    namespace=object_name.namespace,
+                    keybindings=keybindings)
             yield model
 
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |