2016-05-16 8:39 GMT+02:00 Ondrej Lichtner <olichtne(a)redhat.com>:
On Fri, Apr 22, 2016 at 10:52:17AM +0200, Jiri Prochazka wrote:
> in order to export TaskAPI methods to __init__.py,
> we moved it to global level
>
> currently supported - get_alias(), get_mreq(), wait(), get_module()
>
> Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
> ---
> lnst/Controller/Task.py | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
> index 8a4be60..faca548 100644
> --- a/lnst/Controller/Task.py
> +++ b/lnst/Controller/Task.py
> @@ -32,6 +32,18 @@ except:
> # The handle to be imported from each task
> ctl = None
>
> +def get_alias(alias, default=None):
> + return ctl.get_alias(alias, default)
> +
> +def get_mreq():
> + return ctl.get_mreq()
> +
> +def wait(seconds):
> + return ctl.wait(seconds)
> +
> +def get_module(name, options={}):
> + return ctl.get_module(name, options)
> +
> class TaskError(Exception): pass
>
> class ControllerAPI(object):
> @@ -40,10 +52,14 @@ class ControllerAPI(object):
> def __init__(self, ctl, hosts):
> self._ctl = ctl
> self._result = True
> + self.mreq = {}
>
> self._perf_repo_api = PerfRepoAPI()
>
> self._hosts = {}
> +
> + def get_mreq(self):
> + return self.mreq
You've placed this get method in the middle of the __init__ method...
that's not gonna work...
It's fixed in following patches, must've missed that while rebasing
the commits, thanks for catching it!
>
>> for host_id, host in hosts.iteritems():
>> self._hosts[host_id] = HostAPI(self, host_id, host)
>>
>> --
>> 2.4.11
>> _______________________________________________
>> LNST-developers mailing list
>> lnst-developers(a)lists.fedorahosted.org
>>
https://lists.fedorahosted.org/admin/lists/lnst-developers@lists.fedoraho...