"environcmd" option is ignored for "execute"

Create issue
Issue #170 closed
Erik Schnetter created an issue

"sim execute" needs to take the mdb entry "environcmd" into account. All simfactory commands need to do that. This should happen globally when simfactory starts up, not by all simfactory commands individually.

The "sshsetup" mdb entry should then be removed, because it offers the same functionality.

"environcmd" should probably be renamed "envsetup".

Keyword:

Comments (2)

  1. anonymous
    • changed status to resolved
    • removed comment

    sim execute calls simlib.ExecuteCommand. Inside of simlib.ExecuteCommand is the following snippet of code:

    environcmd = GetMachineOption('environcmd') command = "{ %s; } && { %s; }" % (environcmd, command)

    GetMachineOption first checks to see if environcmd was specified via the --environcmd argument, and if not, it grabs it from the mdb entry for the current machine.

    In order to test this, I added this:

    [varia] user = mike environcmd = echo this is my environcmd

    The results of the following command

    varia:simfactory mike$ bin/sim execute ls

    Were:

    Warning: could not resolve hostname varia DEBUG: Simfactory command: bin/../lib/sim.py "execute" "ls" DEBUG: Version 1110 The Simulation Factory: Manage Cactus simulations

    Info: defs: /Users/mike/cactus/Cactus/simfactory/etc/defs.ini Info: defs.local: /Users/mike/cactus/Cactus/simfactory/etc/defs.local.ini Executing command: execute Info: executing command: /bin/bash -c '{ echo this is my environcmd; } && { ls; }'

    this is my environcmd README_FIRST.txt configs etc mdb pysim.tmproj bin doc lib pysim.bbprojectd t.py

    This clearly shows that environcmd was taken into account.

    Lastly, I have renamed environcmd to envsetup throughout. This was a good suggestion and is a bit more intuitive of a name. I don't know how to execute this command once and have it sick, though. Any technical advice in this area would be appreciated.

  2. Log in to comment