Skip to content
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

API Improvements #271

Closed
13 tasks done
tcaiazzi opened this issue Feb 1, 2024 · 0 comments
Closed
13 tasks done

API Improvements #271

tcaiazzi opened this issue Feb 1, 2024 · 0 comments
Assignees
Milestone

Comments

@tcaiazzi
Copy link
Member

tcaiazzi commented Feb 1, 2024

The following list outlines several enhancements and fixes required to improve methods and parameters clarity, maintainability, and usability of Python APIs.

  • **kwargs should not have type, for example Lab.new_machine(self, name: str, **kwargs: Dict[str, Any]) gives a warning in PyCharm
    Image
  • Manager method copy_files(self, machine: Machine, guest_to_host: Dict[str, io.IOBase]), guest_to_host should be Dict[str, Union[str, io.IOBase]] since utils.pack_file_for_tar accepts file_obj with that type.
  • lab.check_integrity should be moved inside deploy_lab of Managers
  • Add device integrity check in deploy_machine
  • Add privileged checks (both for privileged and lab.ext) inside the Managers instead of command (otherwise it is not raised by API). For lab.ext it should also be done in _attach_external_interfaces in DockerLink. For privileged it should also be done in DockerManager.
  • Add connect_tty_obj that takes Machine object instead of name and no lab params, that internally calls the connect_tty with the right params
  • Add exec_obj that takes Machine object instead of name and no lab params, that internally calls the exec with the right params
  • Add get_machine_stats_obj that takes Machine object instead of name and no lab params, that internally calls the get_machine_stats with the right params
  • Add get_link_stats_obj that takes Link object instead of name and no lab params, that internally calls the get_link_stats with the right params
  • Add stream=True/False parameter in exec that, if False, unrolls the stream and returns the bytes results.
  • Separate lab options from global machine metadata.
  • PrivilegeError of machine_stats if all_users=True is now in ListCommand
  • add_line_before/after of FilesystemMixin should also take a Regex instead of a string
@Skazza94 Skazza94 added this to the Release 3.7.3 milestone Feb 1, 2024
tcaiazzi added a commit that referenced this issue Feb 1, 2024
Co-Authored-By: Mariano Scazzariello <marianoscazzariello@gmail.com>
tcaiazzi added a commit that referenced this issue Feb 1, 2024
Co-Authored-By: Mariano Scazzariello <marianoscazzariello@gmail.com>
tcaiazzi added a commit that referenced this issue Feb 5, 2024
tcaiazzi added a commit that referenced this issue Feb 5, 2024
tcaiazzi added a commit that referenced this issue Feb 5, 2024
tcaiazzi added a commit that referenced this issue Feb 7, 2024
tcaiazzi added a commit that referenced this issue Feb 7, 2024
@tcaiazzi tcaiazzi self-assigned this Feb 20, 2024
tcaiazzi added a commit that referenced this issue Feb 22, 2024
Now it is possible  to pass regex as searched line in the following FilesystemMixin methods:
- `write_line_before`
- `write_line_after`
- `delete_line`
tcaiazzi added a commit that referenced this issue Feb 28, 2024
tcaiazzi added a commit that referenced this issue Feb 28, 2024
Skazza94 added a commit that referenced this issue Mar 4, 2024
Skazza94 added a commit that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants