VMware Cloud Community
testaaaz
Contributor
Contributor

infinity compile vRO python action

Hello Community,

 

I create a python action on vRO, and when i run it, i dont receive any result and the action is running to infinity.

And this problem just for python , the others languages is work like a javascript.

 testaaaz_1-1647258017919.png

 

Please, any one he have the solution.

 

 

 

 

Thank you

Reply
0 Kudos
9 Replies
paul_xtravirt
Expert
Expert

Without seeing your code it is very hard to diagnose. Can you post it?

If you found this helpful, please consider awarding some points
Reply
0 Kudos
testaaaz
Contributor
Contributor

This is a simple code :

def handler(context, inputs):
    if inputs.get('name') == 'Jhon':
        print("You are Jhon)
    else:
        print("You are Not Jhon)
Reply
0 Kudos
paul_xtravirt
Expert
Expert

You've got some errors in there that could be corrected and then retest but I don't see why that would cause the issue. Here is the amended code.

 

def handler(context, inputs):
if inputs.get('name') == 'Jhon':
print("You are Jhon")
else:
print("You are Not Jhon")

If you found this helpful, please consider awarding some points
Reply
0 Kudos
testaaaz
Contributor
Contributor

even if I make mistakes on the code, I do not receive any problem, and it remains in the status "in progress" for a long time.

Like that: 

testaaaz_0-1647260212808.png

I think the problem is at the compiler level.

Reply
0 Kudos
xian_
Expert
Expert

Paul's version works perfectly fine. Have you corrected your errors according to his code?

Reply
0 Kudos
testaaaz
Contributor
Contributor

the problem is not in the code, because if it is , i receive a erreur, but in my case the action is running for a long time. without display no error or result

Reply
0 Kudos
xian_
Expert
Expert

Anything in /data/vco/usr/lib/vco/app-server/logs/scripting.log ?

Reply
0 Kudos
testaaaz
Contributor
Contributor

I see no trace of my action when i execute it

Reply
0 Kudos
xian_
Expert
Expert

you may try to re-deploy the services by running

/opt/scripts/deploy.sh

Reply
0 Kudos