Solved

AdminTask error

Posted on 2010-09-22
4
1,569 Views
Last Modified: 2013-12-10
The direct Admintask command works for me

AdminTask.addMemberToGroup('[-memberUniqueName uid=xyz,o=defaultWIMFileBasedRealm -groupUniqueName cn=admins,o=defaultWIMFileBasedRealm]')

but when i try to use it as a Jython list it does not

AdminTask.addMemberToGroup(['-memberUniqueName', 'uid=%s','o=defaultWIMFileBasedRealm','-groupUniqueName','cn=%s','o=defaultWIMFileBasedRealm']) %(info[0],info[5])


com.ibm.ws.scripting.ScriptingException: WASX8009E: Invalid parameter: [Ljava.lang.Object;@53ac53ac


Even when i use it as Jython string it gives error.
AdminTask.addMemberToGroup('[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]') %(info[0],info[5])


CWWIM4001E The 'uid=%s,o=defaultWIMFileBasedRealm' entity

This is happening only for this particular command , all other AdminTask commands are working when using it as a Jython list


I am using this as the reference

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/rxml_atwimmgt.html

Experts  !  Any help is greatly appreciated,


0
Comment
Question by:wasadmin11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 33734256
The command fails because the string format operator (i.e., the %) isn't being used correctly.

It needs to be used like this:

formatString % variable(s)

For example:

'uid=%s' % info[0]

or

'uid=%s ... cn=%s' % %( info[ 0 ], info[ 5 ] )

So, change this line:
 
AdminTask.addMemberToGroup('[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]') %(info[0],info[5])

To this:


AdminTask.addMemberToGroup( '[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]' % ( info[ 0 ], info[ 5 ] ) );

Open in new window

0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33734268
Sorry for the typo in the 2nd example... (sigh)

'uid=%s ... cn=%s' % %( info[ 0 ], info[ 5 ] )

Should actually be:

'uid=%s ... cn=%s' % ( info[ 0 ], info[ 5 ] )
0
 
LVL 2

Author Closing Comment

by:wasadmin11
ID: 33734504
Thanks for the quick response :-) and excellent solution
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33735042
Super.  I'm happy to have been able to help.

Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Article by: Swadhin
Introduction of Lists in Python: There are six built-in types of sequences. Lists and tuples are the most common one. In this article we will see how to use Lists in python and how we can utilize it while doing our own program. In general we can al…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question