-
Notifications
You must be signed in to change notification settings - Fork 234
support for ssh password #167
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
Conversation
Emantor
left a comment
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.
Whats missing is an update to the NetworkService documentation in doc/configuration.rst, together with my review comments looks good to me 👍
labgrid/driver/sshdriver.py
Outdated
| (stdout, stderr, returncode) | ||
| """ | ||
| complete_cmd = "ssh -x {prefix} {user}@{host} {cmd}".format( | ||
| complete_cmd = "ssh -x{prefix} {user}@{host} {cmd}".format( |
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.
As above I'm wondering about the change here.
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.
i found these changes necessary to prevent 2 spaces following each other in the cmd line.
(2 spaces cause split(' ') to add an empty element in the list which will be treated by ssh as the hostname...)
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. In that case I would like you too shuffle the self.ssh_prefix += " -o LogLevel=ERROR" line to the top and handle the extra missing space there. Otherwise we would have to touch the get and put functions as well. I tested your changes against a local device, works fine :)
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.
damn - i missed put and get.
should work now with one change less ;-)
labgrid/driver/sshdriver.py
Outdated
|
|
||
| def on_activate(self): | ||
| self.ssh_prefix = "-i {}".format(os.path.abspath(self.keyfile) | ||
| self.ssh_prefix = " -i {}".format(os.path.abspath(self.keyfile) |
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.
Is this change with the change below necessary? Looks like an unnecessary change to me.
c438a81 to
61dd3fb
Compare
Codecov Report
@@ Coverage Diff @@
## master #167 +/- ##
========================================
- Coverage 51.2% 51.1% -0.1%
========================================
Files 88 88
Lines 4943 4949 +6
========================================
+ Hits 2532 2533 +1
- Misses 2411 2416 +5
Continue to review full report at Codecov.
|
|
was waiting with the documentation till we agreed on the rest ;-) |
labgrid/driver/sshdriver.py
Outdated
| (stdout, stderr, returncode) | ||
| """ | ||
| complete_cmd = "ssh -x {prefix} {user}@{host} {cmd}".format( | ||
| complete_cmd = "ssh -x{prefix} {user}@{host} {cmd}".format( |
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. In that case I would like you too shuffle the self.ssh_prefix += " -o LogLevel=ERROR" line to the top and handle the extra missing space there. Otherwise we would have to touch the get and put functions as well. I tested your changes against a local device, works fine :)
61dd3fb to
15a84a6
Compare
the networkservice resource has a new password property - if it is set the sshdriver will login with sshpass (needs to be installed) instead of the key file Signed-off-by: Tobi Gschwendtner <tg@bloks.de> [r.czerwinski@pengutronix.de: fix commit message, documentation and rebase] Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
15a84a6 to
8770d78
Compare
the sshdriver will login with sshpass (needs to be installed) instead
of the key file
Signed-off-by: Tobi Gschwendtner tg@bloks.de