[Kimchi-devel] [PATCH] [Kimchi] Issue #982 - Fix broken testcases.

Daniel Henrique Barboza dhbarboza82 at gmail.com
Thu Aug 18 14:02:08 UTC 2016


Applied to master. Thanks!

On 08/17/2016 03:18 PM, pvital at linux.vnet.ibm.com wrote:
> From: Paulo Vital <pvital at linux.vnet.ibm.com>
>
> Several testcases started to fail in Fedora 24 after commit 24cc635 added
> a solution to create a temporary file to represent the Virt Viewer script
> contents in mockmodel.py. The solution is not able to create the directory
> in where this temporary file will be created and is failing.
>
> This patch adds a control to make sure the directory exists.
>
> Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
> ---
>   mockmodel.py | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mockmodel.py b/mockmodel.py
> index 2f55af7..cd06ee3 100644
> --- a/mockmodel.py
> +++ b/mockmodel.py
> @@ -141,8 +141,12 @@ class MockModel(Model):
>           cherrypy.engine.subscribe('exit', self.virtviewertmpfile_cleanup)
>   
>       def _create_virt_viewer_tmp_file(self):
> +        path = '../data/virtviewerfiles/'
> +        if not os.path.isdir(path):
> +            os.makedirs(path)
> +
>           self.virtviewerfile_tmp = tempfile.NamedTemporaryFile(
> -            dir='../data/virtviewerfiles/',
> +            dir=path,
>               delete=False
>           )
>           file_content = "[virt-viewer]\ntype=vnc\nhost=127.0.0.1\nport=5999\n"




More information about the Kimchi-devel mailing list