Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

organize remotely executing functions in "cmdeploy.remote" sub package #396

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

hpk42
Copy link
Contributor

@hpk42 hpk42 commented Aug 1, 2024

this PR does not change any business logic but re-organizes "sshexec" calls to remote functions
such that the 'cmdeploy.remote' package is transferred to the remote side and one can
now specify any function relative to the remote sub package, and not just a single module.

This allows to write more code in modules and not having to lump everything into a single remote_funcs.py module.
It also allows all modules in that sub package to import each other.

@hpk42 hpk42 force-pushed the hpk/sshexec-pkg branch 3 times, most recently from ba33968 to 04fe7d5 Compare August 2, 2024 11:31
@hpk42 hpk42 force-pushed the hpk/sshexec-pkg branch from 04fe7d5 to eb1a12a Compare August 8, 2024 22:05
@hpk42 hpk42 force-pushed the hpk/sshexec-pkg branch from eb1a12a to 3ed4af6 Compare August 8, 2024 22:06
cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py Outdated Show resolved Hide resolved
@@ -0,0 +1,17 @@
from subprocess import CalledProcessError as ShellError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exception is renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the module is about running shell commands, and it's not neccessary to leak that it's subprocess.CalledProcessError ... maybe not neccessary but also not hurting i'd say.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this does not change the repr of the exception if it gets into some stacktrace?
Would prefer not renaming imported functions and classes, this just makes it hard to find them in the documentation and any stacktraces will point to the real name anyway.

@hpk42 hpk42 merged commit 8d72d77 into main Sep 2, 2024
6 checks passed
@hpk42 hpk42 deleted the hpk/sshexec-pkg branch September 2, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants