Skip to content

v0.2.0

Choose a tag to compare

@elazar elazar released this 31 Oct 13:11
· 23 commits to main since this release

🐛 Bug Fixes

Shell Command Execution Fixed

The connector now correctly handles shell commands containing quotes, spaces, and special characters.

What was broken:

  • Commands like echo 'hello world' or ls 'path with spaces' were incorrectly split on whitespace
  • The connector used command.split() which broke quoted strings
  • Example: echo "test" became ["echo", '"test"'] instead of ["echo \"test\""]

What's fixed:

  • Commands are now passed as a single string to orbctl run
  • Matches behavior of PyInfra's SSH connector and other connectors
  • All commands with quotes, spaces, and special shell characters now work correctly

Impact:

  • ✅ Commands with single quotes: echo 'hello world'
  • ✅ Commands with double quotes: echo "hello world"
  • ✅ Commands with spaces in paths: ls 'path with spaces'
  • ✅ Complex shell commands with special characters
  • ✅ Standard PyInfra operations like server.shell() with quoted strings

Testing

  • Enhanced test coverage for command handling
  • Added explicit verification of command structure in tests
  • All 56 unit tests pass with 100% connector coverage

📦 Installation

# Using uv (recommended)
uv add pyinfra-orbstack

# Using pip
pip install --upgrade pyinfra-orbstack

🚀 Usage Example

from pyinfra.operations import server

# These now work correctly:
server.shell(
    name="Commands with quotes work now",
    commands=[
        "echo 'SSH is responsive'",
        "ls 'path with spaces'",
        'echo "double quotes work too"',
    ],
)

📝 Full Changelog

Fixed:

  • Connector now passes shell commands as single string to orbctl run instead of splitting on whitespace, fixing commands with quotes and special characters

See CHANGELOG.md for complete details.

🔗 Links