APIPythonOpen-Source Solutions

 View Only
  • 1.  Can i configure Python scripts in hook

    Posted 11-20-2018 09:14:00 PM
    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?

  • 2.  RE: Can i configure Python scripts in hook
    Best Answer

    Posted 11-20-2018 09:43:00 PM

    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?