Skip to main content

Jumpstarter shell driver, for running controlled shell commands on the exporter.

Project description

Shell driver

jumpstarter-driver-shell provides functionality for shell command execution.

Installation

pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ jumpstarter-driver-shell

Configuration

Example configuration:

export:
  shell:
    type: jumpstarter_driver_shell.driver.Shell
    config:
      methods:
        ls: "ls"
        method2: "echo 'Hello World 2'"
        #multi line method
        method3: |
          echo 'Hello World $1'
          echo 'Hello World $2'
        env_var: "echo $1,$2,$ENV_VAR"
      # optional parameters
      cwd: "/tmp"
      log_level: "INFO"
      shell:
        - "/bin/bash"
        - "-c"

API Reference

Assuming the exporter driver is configured as in the example above, the client methods will be generated dynamically, and they will be available as follows:

.. autoclass:: jumpstarter_driver_shell.client.ShellClient
    :members:

.. function:: ls()
   :noindex:

   :returns: A tuple(stdout, stderr, return_code)

.. function:: method2()
    :noindex:

    :returns: A tuple(stdout, stderr, return_code)

.. function:: method3(arg1, arg2)
    :noindex:

    :returns: A tuple(stdout, stderr, return_code)

.. function:: env_var(arg1, arg2, ENV_VAR="value")
    :noindex:

    :returns: A tuple(stdout, stderr, return_code)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jumpstarter_driver_shell-0.6.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jumpstarter_driver_shell-0.6.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file jumpstarter_driver_shell-0.6.0.tar.gz.

File metadata

File hashes

Hashes for jumpstarter_driver_shell-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b968a6fa7edbb6c3a7e2dd0cd936ccd041da7d61bdcc466036355ee4e4fcd103
MD5 ab7538192e91424bde3177caf76ddb54
BLAKE2b-256 25cfcebe66120b514c4d348822995e6544c853423032ec0d45f583efc52a4765

See more details on using hashes here.

File details

Details for the file jumpstarter_driver_shell-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jumpstarter_driver_shell-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1388f8d26de3f5e4f66c490503209a16a69f8fde83050533facab160566cd389
MD5 1c8be305a2da63425b2709cd13cf73df
BLAKE2b-256 464b50a508981d099f9610b2265134c963d1631b3faf97c2357ddca2d5319921

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page