You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
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:
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 currentcommand()
function. Executes commands & returns output viaVirshSessionBase
subclass. Imports and wraps all module-level virsh-command functions.VirshInterfaceBase
- ABC similar to currentVirshPersistant
&Virsh
classes. Interfaces withVirshCommandBase
subclass (which controlsVirshSessionBase
). Responsible for hiding complexity of command execution and output processing.The text was updated successfully, but these errors were encountered: