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

Todo: refine virsh module accessory classes #855

Open
cevich opened this issue Sep 13, 2013 · 0 comments
Open

Todo: refine virsh module accessory classes #855

cevich opened this issue Sep 13, 2013 · 0 comments

Comments

@cevich
Copy link
Member

cevich commented Sep 13, 2013

It seems we have more ways of executing virsh commands coming in than we have facilities in virsh module to deal with. The command function keeps expanding with more conditionals. The VirshSession keeps expanding to support different ways of talking to libvirt.

I propose we move things around slightly to follow a 3-tier approach:

  • Regular module-level function calls should continue working as-is
  • VirshBase class left as-is.
  • VirshSessionBase - ABC providing session-level interface needed to local/remote/other session create, destroy, duplicate, recycle.
  • VirshCommandBase - ABC providing interface to execute commands - supports specialization of current command() function. Executes commands & returns output via VirshSessionBase subclass. Imports and wraps all module-level virsh-command functions.
  • VirshInterfaceBase - ABC similar to current VirshPersistant & Virsh classes. Interfaces with VirshCommandBase subclass (which controls VirshSessionBase). Responsible for hiding complexity of command execution and output processing.
  • Test-modules would instantiate a VirshSessionBase and VirshCommandBase subclass, then pass those to a VirshInterfaceBase subclass. All test interaction would then go through VirshInterface object, allowing commands or sequence of commands to be executed and provide more easily consumable return values back to test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant