[Kimchi-devel] [PATCH] [Kimchi 2/6] Update run_server() calls to do not pass model instance

Lucio Correia luciojhc at linux.vnet.ibm.com
Wed Feb 8 18:03:58 UTC 2017


On 07/02/2017 16:35, Aline Manera wrote:
> The model instance will be gotten from cherrypy when needed.
>
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
>  root.py                           |  3 ++-
>  tests/test_authorization.py       | 10 ++++------
>  tests/test_host.py                | 15 +++------------
>  tests/test_livemigration.py       |  6 +-----
>  tests/test_mock_network.py        | 10 ++++------
>  tests/test_mock_storagepool.py    | 12 ++++--------
>  tests/test_mock_storagevolume.py  | 11 ++++-------
>  tests/test_mockmodel.py           |  8 +++-----
>  tests/test_model_network.py       | 18 +++++++++++-------
>  tests/test_model_storagepool.py   | 18 ++++++++++--------
>  tests/test_model_storagevolume.py | 18 +++++++++++-------
>  tests/test_rest.py                |  7 +++----
>  tests/test_template.py            |  9 ++++-----
>  13 files changed, 64 insertions(+), 81 deletions(-)
>
> diff --git a/root.py b/root.py
> index 3b39c05..68c4a78 100644
> --- a/root.py
> +++ b/root.py
> @@ -48,9 +48,10 @@ class Kimchi(WokRoot):
>          # When running on test mode, specify the objectstore location to
>          # remove the file on server shutting down. That way, the system will
>          # not suffer any change while running on test mode
> -        if wok_options.test:
> +        if wok_options.test is True or wok_options.test.lower() == 'true':

Further testitng it, when running from source, plugin loading is failing 
here:

Failed to import plugin plugins.kimchi.Kimchi, error: 'NoneType' object 
has no attribute 'lower'



>              self.objectstore_loc = tempfile.mktemp()
>              self.model = mockmodel.MockModel(self.objectstore_loc)
> +
>              def remove_objectstore():
>                  if os.path.exists(self.objectstore_loc):
>                      os.unlink(self.objectstore_loc)



-- 
Lucio Correia



More information about the Kimchi-devel mailing list