setup_modules: remove insane source code removal hack

I have no idea why this code is there, but... really? Silently removing
source files from the system?

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
client/setup_modules.py: simplify check for already-present module

This doesn't change the code behavior, but it just replaces a confusing
"try: sys.modules[...] except KeyError:" block with a simple
"if sys.modules.has_key(...)" check.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
setup_modules: simplify setup logic

This kill multiple hacks from the module setup:

 * We don't need _import_children_into_module() anymore. The only case
   where it would be needed and imp.load_package() wouldn't work
   is if root_module_name was "". This won't be supported anymore,
   and root_module_name now defaults to "autotest".

 * The server-package lookup done when root_module_name was
   "autotest.client" is also not necessary, because if the caller
   required the other packages to be available, the caller would already
   break if the server package was unavailable and setup_client_only was
   True.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
setup_modules: kill _monkeypatch_logging_handle_error()

* This code is a hack that mess with the logging module for every
  user of the autotest modules;
* Users interested in handling logging errors can simply register a
  log handler in the root logger, instead of using the hack.
* Logging errors are rare;
* When they happen, their location can be looked up using "git grep".

Such an unimportant use case doesn't deserve an intrusive hack like
that, so I am killing it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
client/net/netutils_unittest.py: Fix crazy imports

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Remove client/setup_modules_unittest.py

The entire unittest is based around the logging hack,
so we don't need it anymore.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
logging_config: don't configure logging without being asked to

If callers/importers of logging_config want to debug/log the module
initialization, they can set up logging themselves. Not every user of
the autotest modules want log messages to suddenly be logged to stderr
just because some autotest modules were imported.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
client/setup_modules.py: Clean docstrings

After the simplification changes we've made, the module
docstrings were quite inaccurate. Let's fix that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend.pkgdeps: Fix missing comma on package list

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
autotest-database-turnkey: Handle use of different APIs

Handle failures trying to import the global_config API
by trying to use the renamed version settings.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
installation_support/autotest-install-packages-deps: Configure logging

So we don't get missing messages from the script.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend/pkgdeps.py: Fix a missing coma on Ubuntu's packages
installation_support/autotest-install-packages-deps: Add --verbose flag

So one can double check what the script did.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
installation_support/autotest-install-packages-deps: Remove misleading docstring

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>