162. OSRExecute

162.1. Authors

  • Johannes Buchhold <jbuch@suse.de>

162.2. Summary of Module Globals

List of Global Functions

  • Command - Wrapper to CommandProgress, with the use of current log file

  • CommandOutput - Executes the given commandline in a bash and writes all execution-information to the standard log file. This function returns all output from the commandline in a result map. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash_output, "rpm -q lilo") resp. WFM::(.local.bash_output, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

  • CommandProgress - Executes the given commandline in a bash and writes all execution-information to the specified logfile. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash, "rpm -q lilo") resp. WFM::(.local.bash, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

List of Global Variables

    162.3. Global Functions

    162.3.1. Command

    Wrapper to CommandProgress, with the use of current log file

    Function parameters

    • path environment

    • string commandline

    Return value

    • boolean

    162.3.2. CommandOutput

    Executes the given commandline in a bash and writes all execution-information to the standard log file. This function returns all output from the commandline in a result map. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash_output, "rpm -q lilo") resp. WFM::(.local.bash_output, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

    Function parameters

    • path environment

    • string commandline

    Return value

    • boolean

    162.3.3. CommandProgress

    Executes the given commandline in a bash and writes all execution-information to the specified logfile. Use these functions instead of directly calling the SCR or WFM agents (e.g. SCR::Execute(.target.bash, "rpm -q lilo") resp. WFM::(.local.bash, "rpm -q -r /mnt lilo")) to be sure to support logging correctly.

    Function parameters

    • path environment

    • string commandline

    • string progress_file

    Return value

    • boolean - Success

    Example 40. 

    	OSRExecute::CommandProgress (.local.bash, "rpm -qi -r /mnt/ lilo",
    		"/tmp/progress_file");
    
       $ cat /tmp/osr.log
       *** /bin/rpm -qi lilo ***
       Name      : lilo         Relocations: (not relocateable)
       Version   : 21.6              Vendor: SuSE GmbH, Nuernberg, Germany
       [...]
       SuSE series: a
       *** exit code: 0 ***


    162.4. Global Variables

    162.5. Module Requirements

    162.5.1. Module Imports

    • Mode
    • OSRCommon
    • OSRLogFile
    • OSRProgress

    162.5.2. Module Includes