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
Solved

AdminTask error

Posted on 2010-09-22
4
1,566 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

809 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