def processSIBusMember(self, k=None, a=None, c=None, action=None): attrDict=a self.logger.warn("processSIBusMember: attrDict %s" % attrDict) cmdDict=c self.logger.warn("processSIBusMember: cmdDict %s" % cmdDict) self.sib = AdminConfig.getid('/SIBusMember:%s/' % cmdDict['server']) self.logger.trace("processSIBusMember: self.sib=%s" % self.sib) if self.sib != '': self.logger.warn("processSIBusMember: server %s already member of the bus %s" % (attrDict['server'], attrDict['bus'])) else: self.logger.info("processSIBusMember: creating %s:%s" % (k, attrDict['bus'])) self.logger.debug("processSIBusMember: command=AdminTask.addSIBusMember(%s)" % (["-%s %s" % (key, value) for key, value in attrDict.items()])) AdminTask.addSIBusMember(["-%s %s" % (key, value) for key, value in attrDict.items()])
def processSIBQueue(self, k=None, a=None, c=None, action=None): attrDict=a attrDict['type'] = 'Queue' self.logger.trace("processSIBQueue: attrDict=%s" % attrDict) cmdDict=c['SIBQueue'] self.logger.trace("processSIBQueue: cmdDict=%s" % cmdDict) self.sib = None queueList = AdminTask.listSIBDestinations(['-bus %s' % attrDict['bus']]).splitlines() self.logger.trace("processSIBQueue: queueList=%s" % queueList) for queue in queueList: self.logger.trace("processSIBQueue: queue=%s" % queue) identifier = AdminConfig.showAttribute(queue, "identifier") self.logger.trace("processSIBQueue: identifier=%s" % identifier) if (identifier == attrDict['name']): self.sib = queue self.logger.trace("processSIBQueue: queue %s already exists" % attrDict['name']) self.logger.trace("processSIBQueue: self.sib=%s" % self.sib) if self.sib != None: self.logger.warn("processSIBQueue: queue %s already exists on bus %s" % (attrDict['name'], attrDict['bus'])) self.logger.trace("processSIBQueue: queue attributes:%s" % AdminConfig.show(self.sib).splitlines()) for key, value in cmdDict.items(): self.logger.trace("processSIBQueue: key=%s, value=%s" % (key, value)) if key != 'scope' and key != 'node' and key != 'server' and key != 'identifier': actualValue = AdminConfig.showAttribute(self.sib, key) self.logger.trace("processSIBQueue: actualValue=%s" % actualValue) if actualValue != value: if action == 'W': self.logger.info("processSIBQueue: modifying attr %s: actualValue=%s, config=%s" % (key, actualValue, value)) self.logger.debug("processSIBQueue: command=AdminTask.modifySIBDestination(['-bus %s','-name %s','-%s %s'])" % (attrDict['bus'], attrDict['name'], key, value)) AdminTask.modifySIBDestination(['-bus', '%s' % attrDict['bus'], '-name', '%s' % attrDict['name'],'-%s' % key, '%s' % value]) else: self.logger.warn("processSIBQueue: audit failure %s:%s: actualValue=%s, config=%s" % (AdminConfig.showAttribute(self.sib,'identifier'), key, actualValue, value)) else: if action == 'W': self.logger.info("processSIBQueue: creating %s:%s" % (k, attrDict['name'])) self.logger.debug("processSIBQueue: command=AdminTask.createSIBDestination(%s)" % (["-%s %s" % (key, value) for key, value in attrDict.items()])) AdminTask.createSIBDestination(["-%s %s" % (key, value) for key, value in attrDict.items()]) else: self.logger.info("processSIBQueue: action is %s, will not be creating %s:%s" % (action, k, attrDict['name']))
def processSIBQueue(self, k=None, a=None, c=None, action=None): attrDict=a attrDict['type'] = 'Queue' self.logger.trace("processSIBQueue: attrDict=%s" % attrDict) cmdDict=c['SIBQueue'] self.logger.trace("processSIBQueue: cmdDict=%s" % cmdDict) self.sib = None queueList = AdminTask.listSIBDestinations(['-bus %s' % attrDict['bus']]).split('\r\n') self.logger.trace("processSIBQueue: queueList=%s" % queueList) for queue in queueList: self.logger.trace("processSIBQueue: queue=%s" % queue) identifier = AdminConfig.showAttribute(queue, "identifier") self.logger.trace("processSIBQueue: identifier=%s" % identifier) if (identifier == attrDict['name']): self.sib = queue self.logger.trace("processSIBQueue: queue %s already exists" % attrDict['name']) self.logger.trace("processSIBQueue: self.sib=%s" % self.sib) if self.sib != None: self.logger.warn("processSIBQueue: queue %s already exists on bus %s" % (attrDict['name'], attrDict['bus'])) self.logger.trace("processSIBQueue: queue attributes:%s" % AdminConfig.show(self.sib).split('\r\n')) for key, value in cmdDict.items(): self.logger.trace("processSIBQueue: key=%s, value=%s" % (key, value)) if key != 'scope' and key != 'node' and key != 'server' and key != 'identifier': actualValue = AdminConfig.showAttribute(self.sib, key) self.logger.trace("processSIBQueue: actualValue=%s" % actualValue) if actualValue != value: if action == 'W': self.logger.info("processSIBQueue: modifying attr %s: actualValue=%s, config=%s" % (key, actualValue, value)) self.logger.debug("processSIBQueue: command=AdminTask.modifySIBDestination(['-bus %s','-name %s','-%s %s'])" % (attrDict['bus'], attrDict['name'], key, value)) AdminTask.modifySIBDestination(['-bus', '%s' % attrDict['bus'], '-name', '%s' % attrDict['name'],'-%s' % key, '%s' % value]) else: self.logger.warn("processSIBQueue: audit failure %s:%s: actualValue=%s, config=%s" % (AdminConfig.showAttribute(self.sib,'identifier'), key, actualValue, value)) else: if action == 'W': self.logger.info("processSIBQueue: creating %s:%s" % (k, attrDict['name'])) self.logger.debug("processSIBQueue: command=AdminTask.createSIBDestination(%s)" % (["-%s %s" % (key, value) for key, value in attrDict.items()])) AdminTask.createSIBDestination(["-%s %s" % (key, value) for key, value in attrDict.items()]) else: self.logger.info("processSIBQueue: action is %s, will not be creating %s:%s" % (action, k, attrDict['name']))
def writeQueuesByScope(scopeIds, qParams, tableId): for s in scopeIds : try : queues = AdminTask.listWMQQueues(s).splitlines() scope = s.split('|')[0].split('(')[1] for q in queues : tArgs = [] for p in qParams : paramValue = AdminConfig.showAttribute(q,p) tArgs.append(paramValue) tArgs.append(scope) tableId.rows.append(tArgs) except : print sys.exc_info()
def processSIB(self, k=None, a=None, action=None): attrDict=a self.sib = AdminConfig.getid('/SIBus:%s/' % attrDict['bus']) if self.sib != '': for key in attrDict.keys(): self.logger.trace("processSIB: key=%s" % key) if key != 'scope' and key != 'bus': self.value=AdminConfig.showAttribute(self.sib, key) self.logger.trace("processSIB: self.value=%s" % self.value) if self.value != attrDict[key]: if action == 'W': self.logger.info("processSIB: modifying %s:%s:%s=%s" % (k, AdminConfig.showAttribute(self.sib,'name'), key, attrDict[key])) self.logger.debug("processSIB: command=AdminTask.modifySIBus(%s)" % (["-%s %s -%s %s" % ('bus', attrDict['bus'], key, attrDict[key])])) AdminTask.modifySIBus(["-%s %s -%s %s" % ('bus', attrDict['bus'], key, attrDict[key])]) else: self.logger.warn("processSIB: audit failure %s:%s, actual=%s config=%s" % (k, AdminConfig.showAttribute(self.sib,'name'), AdminConfig.showAttribute(self.sib, key), attrDict[key])) else: if action == 'W': self.logger.info("processSIB: creating %s:%s" % (k, attrDict['bus'])) self.logger.debug("processSIB: command=AdminTask.createSIBus(%s)" % (["-%s %s" % (key, value) for key, value in attrDict.items()])) AdminTask.createSIBus(["-%s %s" % (key, value) for key, value in attrDict.items()]) else: self.logger.info("processSIB: action is %s, will not be creating %s:%s" % (action, k, attrDict['bus']))
def processSIBusMember(self, k=None, a=None, c=None, action=None): attrDict=a self.logger.trace("processSIBusMember: attrDict %s" % attrDict) cmdDict=c self.logger.trace("processSIBusMember: cmdDict %s" % cmdDict) sibmembers = AdminConfig.list(k, AdminConfig.getid(cmdDict['scope'])).splitlines() self.logger.trace("processSIBusMember: sibmembers=%s" % sibmembers) self.logger.trace("processSIBusMember: sibmembers[0]=%s" % sibmembers[0]) self.sib = None if sibmembers[0] != '': self.logger.trace("processSIBusMember: found members in the bus.") for sibmember in sibmembers: self.logger.trace("processSIBusMember: sibmember=%s" % sibmember) membername = AdminConfig.showAttribute(sibmember, 'server') self.logger.trace("processSIBusMember: membername=%s" % membername) if membername == attrDict['server']: self.sib = sibmember self.logger.trace("processSIBusMember: self.sib=%s" % self.sib) if self.sib != None: self.logger.warn("processSIBusMember: server %s already member of the bus %s" % (attrDict['server'], attrDict['bus'])) else: self.logger.info("processSIBusMember: creating %s:%s" % (k, attrDict['bus'])) self.logger.debug("processSIBusMember: command=AdminTask.addSIBusMember(%s)" % (["-%s %s" % (key, value) for key, value in attrDict.items()])) AdminTask.addSIBusMember(["-%s %s" % (key, value) for key, value in attrDict.items()])
def rolloutUpdateApp(self, appName): updateAppCommand = '[ -ApplicationNames \'' + appName + '\' -timeout ' + str( self.timeout) + ' ]' AdminTask.updateAppOnCluster(updateAppCommand)
dbParams = ['name', 'jndiName', 'provider', 'authDataAlias'] ''' Создание страницы с jvm аргументами ''' for s in servers : servName = s.split('(')[0] nodeName = s.split('/')[3] args = '[-nodeName ' + nodeName + ' -serverName ' + servName + ']' paramValue = AdminTask.showJVMProperties(args) ''' datasourcesId = AdminConfig.list('DataSource').splitlines() for i in datasourcesId : dsScope = i.split('(')[1].split('|')[0] writeParamsToHTML(i, dsScope, dbParams, dbT) ''' queuesFile.close() INDEX_HTML_FILE = 'Index.html' indexFile = open(INDEX_HTML_FILE, 'w') htmlcode = HTML.link('Queues', '.\Queues.html') indexFile.write(htmlcode) indexFile.write('<p>') indexFile.close()