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
Fix spellcheck and missing timeout in sshdriver #286
Changes from all commits
7418d31
a50f6af
bb31a44
0e5d178
9228feb
944a4d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,9 +101,9 @@ def _check_master(self): | |
@Driver.check_active | ||
@step(args=['cmd'], result=True) | ||
def run(self, cmd, codec="utf-8", decodeerrors="strict", timeout=None): # pylint: disable=unused-argument | ||
return self._run(cmd, codec=codec, decodererrors=decodeerrors) | ||
return self._run(cmd, codec=codec, decodeerrors=decodeerrors) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we pass on the timeout value to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Timeout is actually ignored. commandmixin just happen to pass it to sshdriver. |
||
|
||
def _run(self, cmd, codec, decodeerrors): # pylint: disable=unused-argument | ||
def _run(self, cmd, codec="utf-8", decodeerrors="strict", timeout=None): # pylint: disable=unused-argument | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If timeout value is passed on from |
||
"""Execute `cmd` on the target. | ||
|
||
This method runs the specified `cmd` as a command on its target. | ||
|
@@ -143,7 +143,7 @@ def get_status(self): | |
|
||
@Driver.check_active | ||
@step(args=['filename', 'remotepath']) | ||
def put(self, filename, remotepath=None): | ||
def put(self, filename, remotepath=''): | ||
transfer_cmd = "scp {prefix} -P {port} {filename} {user}@{host}:{remotepath}".format( | ||
filename=filename, | ||
user=self.networkservice.username, | ||
|
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.
Where are the variables
codec
anddecodeerrors
supposed to come from? I guess you missed updatingdef _run_check(self, cmd: str, timeout=30):
with these arguments, right?
The problem is not every
_run()
methods knows aboutcodec
anddecodeerrors
, so this breaks everywhere else.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.
You should either transform the
_run()
method ofBareboxDriver
,UBootDriver
andSmallUBootDriver
or go without CommandMixin's convenience functionrun_check
on targets with decode errors.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.
You're right. I hope that these run functions will be stable soon and not have more special options.
I will add these but as unused parameters, because I don't see any use for codec's in these drivers.
Better test functions would help a lot. In my PR for the remote_tmpdir I actually have a test case which covers the SSH driver better.