Can i configure Python scripts in hook

  • 0
  • 1
  • Question
  • Updated 3 weeks ago
  • Answered
We have a need to identify schema changes of VDB. So, automated code in python to extract and compare metadata, before and after refresh.

Can these python scripts be configured as hook in VDB?
Photo of santosh kumar

santosh kumar

  • 450 Points 250 badge 2x thumb

Posted 3 weeks ago

  • 0
  • 1
Photo of Tim Gorman

Tim Gorman, Field Services

  • 3,184 Points 3k badge 2x thumb
Official Response
Santosh,

Yes.  Hooks on UNIX/Linux environments run in bash and hooks on Windows environment run in powershell.

Either way, you can start a python script as you would normally in either of those shells (i.e. "python script-name.py", etc).

The trick is likely exiting from shell with the exit status from the script, so follow the call to the python script with "exit $?" in bash and perhaps "exit $LastExitCode" or "exit $?" in powershell.

Hope this helps?

-Tim