|
|
|
Chgclonid
Action : was.chgclonid (Category : was, Name : chgclonid, By : kikonf)
Complete Name : was.chgclonid.by.kikonf Version : 5.0 License : Modified BSD License Purpose of the was category : Easy to customize. This category use in background the wsadmin command in jython mode (through AdminConfig, AdminControl and AdminTask), to drive WebSphere Application Server ® configuration. You can use it to manage the whole WebSphere ® architecture. Purpose of this chgclonid plugin : Changes a Cluster Member's clone id, insteresting for proxiying considerations. The following shows the main Source Code File for the Action : was.chgclonid Toggle lines ## Copyright (c) 2008, Patrick Germain Placidoux ## All rights reserved. ## ## This file is part of Kikonf Public Software. ## ## Kikonf Public Software is released under the modified BSD License, ## which should accompany it or any part of it in the file "COPYING". ## If you do not have this file you can access the license ## through the WWW at http://www.kikonf.org/license/bsd/license.txt. ## ## Home: http://www.kikonf.org ## Contact: kikonf@gmx.com from actions.was.tools import * class Chgclonid(wasAction): def extract(self, scope_attrs=None, **keywords): self_funct='extract' self.verbose(scope_attrs) scope_id, scope_attrs, scope=self.getScope(scope_attrs=scope_attrs, indent=self.getIndent()) indent=self.getIndent() + 3*' ' if 'cluster' not in scope_attrs.keys():raise xception.kikonfActionParameterException(self, self_funct, 'Chgclonid support Cluster Member, the Attribute "cluster" of your scope must be set ! Your scope:' + str(scope_attrs) + '.') chgclonid_node=self.newTop() id=AdminConfig.showAttribute(scope_id, 'uniqueId') chgclonid_node.setAttrs(id=id) mkNodeScope(chgclonid_node, scope_attrs, isUnique=True) def inject(self): self_funct='inject' chgclonid_node = self.getTop() #-- Grabs top node chgclonid_attrs = chgclonid_node.getAttrs() scope_id, scope_attrs, scope=self.getScope(parent_node=chgclonid_node, indent=self.getIndent()) #-- Retreives scope self.verbose(scope_attrs) indent=self.getIndent() + 3*' ' cmdvalues=[] cmdvalues.append(['uniqueId', chgclonid_attrs.id]) verbose('ClusterMember:' + scope_attrs['server'] + ' retreiving.', level=self.getVerbose(), ifLevel=4, indent=indent, logFile=self.getLogFile()) AdminConfig.modify(scope_id, cmdvalues) verbose('ClusterMember:' + scope_attrs['server'] + ', clonid:' + chgclonid_attrs.id + ' modified.', level=self.getVerbose(), ifLevel=3, indent=indent, logFile=self.getLogFile()) def verbose(self, scope_attrs): scope=str(scope_attrs).replace("'", '')[1:-1] verbose('Cluster Member CloneId at scope:' + scope + '.', level=self.getVerbose(), ifLevel=2, indent=self.getIndent())
Trademarks :
|