-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add mech connector #198
Add mech connector #198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mech ls
appears to list available boxes, rather than running instances, which would cause issues here.
Since mech only supports a single instance at once I think this connector should reflect that - in which case the connector should only need execute mech ssh-info
to figure out the connection info.
A later extension could be to support multiple Mechfile
s using a syntax roughly like:
pyinfra @mech/path/to/dir @mech/path/to/other/dir
The See https://github.com/mkinney/pyinfra/blob/add-mech-connector/tests/test_connector_mech.py#L30 for example output. So, the output from the first comment should have run against all 9 hosts, but it only ran against one. Not sure why. I guess I'll take another look today. Note that there is a bug in mech code that does not properly show the host when you run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see - so mech ssh-config <name>
will work anywhere (not requiring Mechfile
in the same dir). In that case it should work as expected - once the issue with Mech itself is fixed.
I've outlined one possible workaround below which should get this running without Mech being fixed/released.
Working for me now:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkinney awesome! Will update & merge.
Ah there's a couple of linting things to fix in the tests - https://travis-ci.org/Fizzadar/pyinfra/jobs/633683328#L326. |
Sorry about that. I'll run flake8 tests in the future. I mostly ignored these warnings. Let me know if you want them handled differently. |
Codecov Report
@@ Coverage Diff @@
## master #198 +/- ##
==========================================
+ Coverage 88.09% 88.25% +0.16%
==========================================
Files 86 87 +1
Lines 4677 4770 +93
==========================================
+ Hits 4120 4210 +90
- Misses 557 560 +3
Continue to review full report at Codecov.
|
@mkinney no worries - thank you for fixing! I only recently added flake8 to the tests to enforce style. |
Working on #197
This does not work as expected yet. Need help on this.
Pyinfra only seems to run against one of the hosts because they all return "localhost" (or some other issue):
Any ideas?