Thanks for all of the feedback, it has been helpful. I'm just starting to work with scripting BL and have a lot to learn. I have a question about the last 2 responses;
1) How do you enable 'unreleased' commands?
2) How do you import BRProfile?
If you could just point me in the right direction I would appreciate it.
If you are using jythin / jli you just need to include the import statement at the top of your script. Use the line below:
*from com.bladelogic.client import BRProfile
Then call BRProfile.getCurrentRole() to get the current role.
I am not sure how you do it in NSH script to be honest!
How to use from com.bladelogic.client import BRProfile?
When I add this line to my code and get the following error. Can you please help me on this?
Error Apr 3, 2012 2:49:16 PM ImportError: cannot import name BRProfile
Error Apr 3, 2012 2:49:16 PM from com.bladelogic.client import BRProfile
Error Apr 3, 2012 2:49:16 PM File "Program Files\BMC Software\BladeLogic\NSH\share\sensors\changeProp.jli", line 11, in <module>
Error Apr 3, 2012 2:49:16 PM Traceback (most recent call last):
My jli code is as below and executing through NSH JOB:
import string as s
import bladelogic.cli.CLI as blcli
from com.bladelogic.client import BRProfile
JOB_GROUP = sys.argv
JOB_NAME = sys.argv
jli = blcli.CLI()
set = jli.setServiceProfileName()
JOB_KEY1 = jli.run(cmd)
JOB_KEY = JOB_KEY1.returnValue
I am going to upload a document today, will update you.
This does not happen often, has happened only in 8.x, I have not seen this since 7.x
here is the document: