You are seeing the correct behavior. If you define vmware_name as a
Python list, then you need to access the appropriate item in the list.
This might be clearer if you try this using Python (outside of STAX):
$ python
>>> vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
>>> vmware_name
['"c:\\vmware\\RedHat\rhel3.vmx"']
>>> vmware_name[0]
'"c:\\vmware\\RedHat\rhel3.vmx"'
>>>
Notice that when you reference "vmware_name", the output you get includes
the square braces, since you are referencing the entire variable, which
you defined as a Python list.
When you reference "vmware_name[0]" you get the first item in the list.
Thanks,
David
David Bender
STAF/STAX Development
IBM Software Group, WPLC
11501 Burnet Rd.
Bldg. 903-5B002
Austin, TX 78758-3400
Phone (T/L): 1-512-286-5315 (363-5315)
ITN: 23635315
Email: bda...@us.ibm.com
Sangram Bakshi <san...@gmail.com>
08/20/2009 07:29 AM
To
staf-users@lists.sourceforge.net
cc
Subject
Re: [staf-users] Unable to start vmware through a stax job
Hi ,
I would like to add that , considering the code:
vmware_name would come as list ,i.e it could be multiple vmware names in
the list , so vmware_name is a list.
However , if i have vmware_name = '"c:\\vmware\RedHat\rhel3.vmx"' (as a
single variable )
I am able to start the vmware . If i have the same thing in a list , i am
not able to start the vmware.
Kindly suggest .
<script>
vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
vmware_root = '"c:\\Program Files\VMware\\VMware Workstation\\vmrun.exe"'
machList = ['somemachine']
start = 'start'
</script>
<paralleliterate var="machName" in="machList" indexvar="i">
<process name="'Starting VMware on machine %s.....' % machName">
<location>machName</location>
<command mode="'shell'">'%s %s %s ' % (vmware_root, start,
vmware_name) </command>
</process>
</paralleliterate>
Regards
Sangram
On Thu, Aug 20, 2009 at 5:34 PM, Sangram Bakshi <san...@gmail.com> wrote:
Hi ,
I am trying to start a vmware from a stax job .
>From the command line of a windows machine we can start a vmware by doing
a:
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" start
"C:\vmware\RedHat\rhel3.vmx"
Considering if i want to start the vmware "C:\vmware\RedHat\rhel3.vmx".
Now i want the same to be done from a stax job.
The machine from where i am trying to start the vmware is staf-stax active
i.e staf runs here .
Now the code i use is (I am not using the function which is there in the
STAF faq ,i am simply trying to use the command to start the vmware.)
somemachine = machine where staf and stax is running already.
<script>
vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
vmware_root = '"c:\\Program Files\VMware\\VMware Workstation\\vmrun.exe"'
machList = ['somemachine']
start = 'start'
</script>
<paralleliterate var="machName" in="machList" indexvar="i">
<process name="'Starting VMware on machine %s.....' % machName">
<location>machName</location>
<command mode="'shell'">'%s %s %s ' % (vmware_root, start,
vmware_name) </command>
</process>
</paralleliterate>
Kindly suggest any improvements so that i can start the vmware just by
giving the command.
Regards
Sangram
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users