ShellDriver: add optional arg dest_authorized_keys
ShellDriver: add optional arg dest_authorized_keys
Add an addition optional arg "dest_authorized_keys" with the default value of ~/.ssh/authorized_keys,
An example where this might be used is when an embedded system uses dropbear as it's ssh server daemon. In such a case, the authorized_keys file is /etc/dropbear/authorized_keys
Additionally, the put_key_file takes an optional dest_authorized_keys function parameter which defaults to the above arg.
Update docs
Checklist
- [x] Documentation for the feature
- [x] Tests for the feature: runtime test with the arg set and without the arg set.
- [x] PR has been tested locally
Fixes: #1626
Isn't a keyword argument with default for the put_ssh_key() function not enought to achieve this? Do we need the additional driver argument?
Isn't a keyword argument with default for the
put_ssh_key()function not enought to achieve this? Do we need the additional driver argument?
put_ssh_key() is called from on_activate(). So, no. I don't think it would work as you suggested.
https://github.com/labgrid-project/labgrid/blob/0b9dd26940103cde1fc9c72384ee01ef5cdc933d/labgrid/driver/shelldriver.py#L70-L75
Making this an automatic upload on keyfile availability on activation is a design decision I'd like to revise with the original author. I'll have stern talking to with myself, your implementation looks fine and changing this is not something I want to do at this point in time. Is there a specific reason for switching to """ for the f-strings?
The logging functions will also need to be fixed to not use f-strings.
Making this an automatic upload on
keyfileavailability on activation is a design decision I'd like to revise with the original author. I'll have stern talking to with myself, your implementation looks fine and changing this is not something I want to do at this point in time. Is there a specific reason for switching to"""for the f-strings? The logging functions will also need to be fixed to not use f-strings.
I can imagine that removing the put_ssh_key() from on_activate() will break a lot of people's code. So making that change, which is totally the decision of the maintainers, is totally fine with me as I would be aware of it and can modify my code.
I used the """ f-strings because it seems (from the code that I have looked at within labgrid) that it is the most-often style used. I personally also find that style quite readable. Could you please explain what you mean by "The logging functions will also need to be fixed to not use f-strings"?