Solved

AdminTask error

Posted on 2010-09-22
4
1,550 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the quick response :-) and excellent solution
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
Super.  I'm happy to have been able to help.

Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
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.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now