Kathara
Kathara copied to clipboard
API Improvements
The following list outlines several enhancements and fixes required to improve methods and parameters clarity, maintainability, and usability of Python APIs.
- [x]
**kwargsshould not have type, for exampleLab.new_machine(self, name: str, **kwargs: Dict[str, Any])gives a warning in PyCharm - [x]
Managermethodcopy_files(self, machine: Machine, guest_to_host: Dict[str, io.IOBase]),guest_to_hostshould beDict[str, Union[str, io.IOBase]]sinceutils.pack_file_for_taracceptsfile_objwith that type. - [x]
lab.check_integrityshould be moved insidedeploy_labof Managers - [x] Add device integrity check in
deploy_machine - [ ] Add privileged checks (both for
privilegedandlab.ext) inside the Managers instead of command (otherwise it is not raised by API). Forlab.extit should also be done in_attach_external_interfacesinDockerLink. Forprivilegedit should also be done inDockerManager. - [x] Add
connect_tty_objthat takesMachineobject instead of name and no lab params, that internally calls theconnect_ttywith the right params - [x] Add
exec_objthat takesMachineobject instead of name and no lab params, that internally calls theexecwith the right params - [x] Add
get_machine_stats_objthat takesMachineobject instead of name and no lab params, that internally calls theget_machine_statswith the right params - [x] Add
get_link_stats_objthat takesLinkobject instead of name and no lab params, that internally calls theget_link_statswith the right params - [x] Add
stream=True/Falseparameter inexecthat, ifFalse, unrolls the stream and returns thebytesresults. - [ ] Separate lab options from global machine metadata.
- [ ]
PrivilegeErrorofmachine_statsifall_users=Trueis now inListCommand - [x] add_line_before/after of
FilesystemMixinshould also take a Regex instead of a string