Avocado compatibility: handle new settings behavior
Avocado has introduced a new settings module implementation, currently
available as "avocado.core.future.settings, but with the goal of
replacing the one at "avocado.core.settings".
If find that the this new implementation is available, we can be
certain that we're dealing with configurations that are dictionaries,
and never and argparse.Namespace instance.
Also, because it will live in the same location as the current one,
and because the change will happen at a given point before a release,
we need to implement some heuristic to check for new or old
implementation.
When using the new implementation, it means that new responsibilities
are needed, and registering the core options is required. In this
case, the compatibility helpers get_opt()/set_opt() can now be defined
according to the presence of the settings implementation, because that
will guarantee that the opts will be a dictionary or not.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
想要评论请 注册 或 登录