def processConfigItem(self, cmdDict=None, action=None):
     '''processConfigItem: This method processes a single configuration object. It takes two parameters, a dictionary containing the command and the action (RW)'''
     self.logger.trace("processConfigItem: cmdDict=%s" % cmdDict)
     if cmdDict == None:
         self.logger.error("processConfigItem: No dictionary was passed to the generateCommands method")
         raise ProcessCommandException("No dictionary was passed to the generateCommands method")
     #end-if
     k = cmdDict.keys()[0]
     v = cmdDict.values()[0]
     self.logger.trace("processConfigItem: key=%s, value=%s" % (k, v))
     template = self.setTemplate(key=k, valueDict=v)
     self.logger.trace("processConfigItem: template=%s" % template)
     try:
         self.validateScope(valueDict=v, method='processConfigItem', key=k)
     except ProcessCommandException:
         self.logger.info("processConfigItem: Skipping ConfigItem %s:%s." % (k, v))
     else:
         self.logger.trace("processConfigItem: scope=%s " % AdminConfig.getid(v['scope']))
         self.logger.trace("processConfigItem: finding object command=AdminConfig.getid('/%s:%s/') " % (k, v['name']))
         obj = AdminConfig.getid('/%s:%s/' % (k, v['name']))
         self.logger.trace("processConfigItem: obj=%s " % obj)
         if obj == "":
             self.logger.trace("processConfigItem: obj not found, creating...")
             attrList = []
             for key in v.keys():
                 if key != 'scope':
                     attrList.append([key, v[key]])
                 #end-if
             #end-for
             self.logger.trace("processConfigItem: attrList=%s" % attrList)
             self.logger.trace("processConfigItem: template=%s" % template)
             if template == None:
                 self.logger.trace("processConfigItem: template was not found...")
                 if action == 'W':
                     if k == 'J2CActivationSpec':
                         self.logger.trace("processConfigItem: key is J2CActivationSpec so fixing attribute list")
                         attr = AdminConfig.list('ActivationSpec', AdminConfig.getid(v['scope']))
                         attrList.append(['activationSpec', attr])
                     elif k == 'J2CAdminObject':
                         self.logger.trace("processConfigItem: key is J2CAdminObject so fixing attribute list")
                         attr = AdminConfig.list('AdminObject', AdminConfig.getid(v['scope']))
                         attrList.append(['adminObject', attr])
                     elif k == 'J2CConnectionFactory':
                         self.logger.trace("processConfigItem: key is J2CConnectionFactory so fixing attribute list")
                         attr = AdminConfig.list('ConnectionDefinition', AdminConfig.getid(v['scope']))
                         attrList.append(['connectionDefinition', attr])
                     self.logger.info("processConfigItem: creating %s:%s:%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                     self.logger.debug("processConfigItem: command=AdminConfig.create('%s', %s, %s)" % (k, AdminConfig.getid(v['scope']), attrList))
                     AdminConfig.create('%s' % k, AdminConfig.getid(v['scope']), attrList)
                 else:
                     self.logger.warn("processConfigItem: action is set to %s.  Item %s:%s:%s will not be created.  Attribute and properties for this object will not exist and may cause failures in this script." % (action, AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                 #end-if
             else:
                 self.logger.trace("processConfigItem: template was found...")
                 if action == 'W':
                     self.logger.info("processConfigItem: creating %s:%s:%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                     self.logger.trace("processConfigItem: template=%s" % template)
                     self.logger.debug("processConfigItem: command=AdminConfig.createUsingTemplate('%s', %s, %s, %s)" % (k, AdminConfig.getid(v['scope']), attrList, template))
                     AdminConfig.createUsingTemplate('%s' % k, AdminConfig.getid(v['scope']), attrList, template)
                 else:
                     self.logger.warn("processConfigItem: action is set to %s.  Item %s:%s:%s will not be created.  Attribute and properties for this object will not exist and may cause failures in this script." % (action, AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                 #end-if
             #end-if
         #end-if
         else:
             for key in v.keys():
                 if key != 'scope':
                     actual = AdminConfig.showAttribute(obj, key)
                     self.logger.trace("processConfigItem: attribute=%s, value=%s" % (key, actual))
                     if actual != v[key]:
                         if action == 'W':
                             self.logger.info("processConfigItem: modifying actual=%s to %s" % (actual,v[key]))
                             self.logger.debug("processConfigItem: command=AdminConfig.modify(%s, [['%s', '%s']])" % (obj, key, v[key]))
                             AdminConfig.modify(obj, [[key, v[key]]])
                         else:
                             self.logger.warn("processPropertySet: audit failure %s:%s, actual=%s config=%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), (AdminConfig.showAttribute(obj, 'name')), (AdminConfig.showAttribute(obj, key)), v[key]))
 def processConfigItem(self, cmdDict=None, action=None):
     '''processConfigItem: This method processes a single configuration object. It takes two parameters, a dictionary containing the command and the action (RW)'''
     self.logger.trace("processConfigItem: cmdDict=%s" % cmdDict)
     if cmdDict == None:
         self.logger.error("processConfigItem: No dictionary was passed to the generateCommands method")
         raise ProcessCommandException("No dictionary was passed to the generateCommands method")
     #end-if
     k = cmdDict.keys()[0]
     v = cmdDict.values()[0]
     self.logger.trace("processConfigItem: key=%s, value=%s" % (k, v))
     template = self.setTemplate(key=k, valueDict=v)
     self.logger.trace("processConfigItem: template=%s" % template)
     try:
         self.validateScope(valueDict=v, method='processConfigItem', key=k)
     except ProcessCommandException:
         self.logger.info("processConfigItem: Skipping ConfigItem %s:%s." % (k, v))
     else:
         self.logger.trace("processConfigItem: scope=%s " % AdminConfig.getid(v['scope']))
         self.logger.trace("processConfigItem: finding object command=AdminConfig.getid('/%s:%s/') " % (k, v['name']))
         obj = AdminConfig.getid('/%s:%s/' % (k, v['name']))
         self.logger.trace("processConfigItem: obj=%s " % obj)
         if obj == "":
             self.logger.trace("processConfigItem: obj not found, creating...")
             attrList = []
             for key in v.keys():
                 if key != 'scope':
                     attrList.append([key, v[key]])
                 #end-if
             #end-for
             self.logger.trace("processConfigItem: attrList=%s" % attrList)
             self.logger.trace("processConfigItem: template=%s" % template)
             if template == None:
                 self.logger.trace("processConfigItem: template was not found...")
                 if action == 'W':
                     if k == 'J2CActivationSpec':
                         self.logger.trace("processConfigItem: key is J2CActivationSpec so fixing attribute list")
                         attr = AdminConfig.list('ActivationSpec', AdminConfig.getid(v['scope']))
                         attrList.append(['activationSpec', attr])
                     elif k == 'J2CAdminObject':
                         self.logger.trace("processConfigItem: key is J2CAdminObject so fixing attribute list")
                         attr = AdminConfig.list('AdminObject', AdminConfig.getid(v['scope']))
                         attrList.append(['adminObject', attr])
                     elif k == 'J2CConnectionFactory':
                         self.logger.trace("processConfigItem: key is J2CConnectionFactory so fixing attribute list")
                         attr = AdminConfig.list('ConnectionDefinition', AdminConfig.getid(v['scope']))
                         attrList.append(['connectionDefinition', attr])
                     self.logger.info("processConfigItem: creating %s:%s:%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                     self.logger.debug("processConfigItem: command=AdminConfig.create('%s', %s, %s)" % (k, AdminConfig.getid(v['scope']), attrList))
                     AdminConfig.create('%s' % k, AdminConfig.getid(v['scope']), attrList)
                 else:
                     self.logger.warn("processConfigItem: action is set to %s.  Item %s:%s:%s will not be created.  Attribute and properties for this object will not exist and may cause failures in this script." % (action, AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                 #end-if
             else:
                 self.logger.trace("processConfigItem: template was found...")
                 if action == 'W':
                     self.logger.info("processConfigItem: creating %s:%s:%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                     self.logger.trace("processConfigItem: template=%s" % template)
                     self.logger.debug("processConfigItem: command=AdminConfig.createUsingTemplate('%s', %s, %s, %s)" % (k, AdminConfig.getid(v['scope']), attrList, template))
                     AdminConfig.createUsingTemplate('%s' % k, AdminConfig.getid(v['scope']), attrList, template)
                 else:
                     self.logger.warn("processConfigItem: action is set to %s.  Item %s:%s:%s will not be created.  Attribute and properties for this object will not exist and may cause failures in this script." % (action, AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), k, v['name']))
                 #end-if
             #end-if
         #end-if
         else:
             for key in v.keys():
                 if key != 'scope':
                     actual = AdminConfig.showAttribute(obj, key)
                     self.logger.trace("processConfigItem: attribute=%s, value=%s" % (key, actual))
                     if actual != v[key]:
                         if action == 'W':
                             self.logger.info("processConfigItem: modifying actual=%s to %s" % (actual,v[key]))
                             self.logger.debug("processConfigItem: command=AdminConfig.modify(%s, [['%s', '%s']])" % (obj, key, v[key]))
                             AdminConfig.modify(obj, [[key, v[key]]])
                         else:
                             self.logger.warn("processPropertySet: audit failure %s:%s, actual=%s config=%s" % (AdminConfig.showAttribute(AdminConfig.getid(v['scope']), 'name'), (AdminConfig.showAttribute(obj, 'name')), (AdminConfig.showAttribute(obj, key)), v[key]))