Automic Workload Automation

 View Only
  • 1.  BEGIN_EXT_INT PYTHON

    Posted Feb 21, 2020 10:29 AM
    ​Hi,

    I'm trying to test the use of f.ex. Python external interpreter in v12.3, but I fail miserably.

    I have added both Python and PHP as interpreters in UC_EXT_INTERPRETERS_WINDOWS in client 0.

    Running this code in the process tab of a Windows job:

    produces below error:

    U02000254 Error found on completing data for task '2048838130', reason: '5 - Access is denied.'.

    I note that the AWI for some reason cannot recognize :END_EXT_INTERPRETERS as a valid script command (it is greyed out) as opposed to the :BEGIN_EXT_INTERRETERS command.

    When I comment line 3 out, line 5 is recognized as a command, but job now fails due to missing Python commands between BEGIN and END.

    Any suggestions?

    ------------------------------
    Kind regards,

    Dan Petersen, aka Don P
    ------------------------------


  • 2.  RE: BEGIN_EXT_INT PYTHON

    Posted Feb 21, 2020 10:33 AM
    Edited by Diane Craddock Mar 03, 2020 08:56 AM

    ​Hey,

    As per the manual, it's BEGIN_EXT_INTERPRETER (edit: typo) and END_EXT_INTERPRETER (singular, not plural).

    I wonder if that has any effect on your greyed-out syntax woes?

    Br,
    Carsten



    ------------------------------
    These contain very good advise on asking questions and describing supposed bugs (no, you do not need to go to StackExchange for Automic questions, but yes, the parts on asking detailed, useful questions ARE usually relevant):

    http://www.catb.org/~esr/faqs/smart-questions.html

    https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

    I will not respond to PM asking for help unless there's an actual reason to keep the discussion off of the public forums.
    ------------------------------



  • 3.  RE: BEGIN_EXT_INT PYTHON

    Posted Feb 24, 2020 03:19 AM
    Edited by Don_P Feb 24, 2020 03:24 AM
    ​Thank you Carsten,

    That helped (should have spotted that myself).

    The grey-out was caused by the bang (!) in the print statement, apparently that's not allowed.

    BTW. where should the ext interpreter, Python in this case, reside? On engine servers or on the server chosen for the Windows or Unix job? 

    Br. Dan


  • 4.  RE: BEGIN_EXT_INT PYTHON
    Best Answer

    Broadcom Employee
    Posted Feb 25, 2020 02:58 AM
    The interpreter has to be located on the machine where the Agent is located. 
    At the end it is just a command line call of a temporarily created Script file.

    You may use the ':attach_res' function to copy the necessary (pyhon) interpreter file on the agent machine just before the script get executed.
    This is an example with the Javascript interpreter:
    :attach_res store.js, "*", "T", "N"
    :set &cache_path# = get_var('UC_EX_PATH_CACHE', &$AGENT# )
    CLASSPATH=.:$CLASSPATH:&cache_path#/&$client#/js.jar
    export CLASSPATH
    
    :BEGIN_EXT_INT JS
    
    var name = "var1";
    var value = "value";
    :  register_variable name, value
    
    :END_EXT_INT JS​



    ------------------------------
    Sr. Solution Architect
    Broadcom
    ------------------------------



  • 5.  RE: BEGIN_EXT_INT PYTHON

    Posted Feb 25, 2020 04:42 AM
    Thanks Kay. Much appreciated.

    Br.
    Dan