Question

I am trying to include a variable in my jython script to hold my nodename, but I end up getting BSFEXception. My script is this :

node=AdminControl.getNode()
AdminTask.installBusinessSpaceWidgets('[-nodeName %node% -serverName server1 -widgets C:/package/widgets/Widgets.zip]')

While I could do this with jacl, I couldn't find a way to do it in jython - which is what most of my scripts are written in.

Était-ce utile?

La solution

The syntax is:

node=AdminControl.getNode()
AdminTask.installBusinessSpaceWidgets('[-nodeName %s -serverName server1 -widgets C:/package/widgets/Widgets.zip]' % node)

Using a real list can be more convenient sometimes:

node=AdminControl.getNode()
AdminTask.installBusinessSpaceWidgets(['-nodeName', node, '-serverName', 'server1', '-widgets', 'C:/package/widgets/Widgets.zip'])
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top