Skip to content

Rework SSHExec #629

@missytake

Description

@missytake

SSHExec is an object in cmdeploy.py, which we can use to get the result of bash commands on the relay. Since it was last reworked in #396, our needs have evolved. Obstacles of the current implementation:

  • it always invariably connects to mail_domain, the relay host
  • it is initialized in cmdeploy.py's main() function, so the functions which come afterwards can hardly modify it
  • it doesn't offer to simply pass a bash command, you need to pass a function to it which calls a remote.rshell method
  • it offers two different callback functions for console output, but no option to suppress it completely
  • the various functions which execute the bash command on the target system are spread out over many different files: cmdeploy.py, dns.py, sshexec.py, remote/rdns.py, and remote/rshell.py

Situations in which we need it to work differently:

The current implementation has a certain elegance to it, to make it easier to test; I wonder whether it can be enhanced to fit all these needs. At the same time it would be nice to make it simpler and more maintainable (it took me a few weeks to understand the current obstacles well enough to write down this issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions