uyuni-project / virtual-host-gatherer

Script to gather information about virtual system running on different kind of hypervisors.
6 stars 13 forks source link

virtual-host-gatherer Gatherer.__init__() workflow negatively impacts using code in other projects #28

Closed rtamalin closed 2 years ago

rtamalin commented 2 years ago

The current code required than an argparse.Namespace() instance is passed in that defines a logfile attribute pointing to a file that is valid for setting up as a logging target, and unconditionally sets up logging for that file, and the stderr stream.

However if we are trying to leverage the Gatherer() from inside another project, we want to be able to manage the logging setup within that project, and not have to worry about side-effects caused by initialising the Gatherer.

With some small tweaks it should be possible to retain the same fundamental workflow when Gatherer is used by the virtual-host-gatherer CLI command, but allow other projects to include the code without an opts argument or worry about logging side-effects.

Will propose a candidate change soon..