From pvital at linux.vnet.ibm.com Wed Feb 5 12:15:56 2014 Content-Type: multipart/mixed; boundary="===============8373747303072402372==" MIME-Version: 1.0 From: Paulo Ricardo Paz Vital To: kimchi-devel at ovirt.org Subject: Re: [Kimchi-devel] [PATCH] bug fix: Set full path to guest page file in guest tab Date: Wed, 05 Feb 2014 15:15:50 -0200 Message-ID: <1391620550.22516.24.camel@hornet.br.ibm.com> In-Reply-To: 1391620339-12617-1-git-send-email-alinefm@linux.vnet.ibm.com --===============8373747303072402372== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable -- = Reviewed-by: Paulo Vital Tested-by: Paulo Vital On Wed, 2014-02-05 at 15:12 -0200, Aline Manera wrote: > From: Aline Manera > = > Commit 6bcbb3f0 changed how the guest tab is loaded to be more robust, bu= t it > was using relative path to guest page which causes errors when Kimchi is > running outside its top directory. > So use full path to avoid those kind of problems. > = > Signed-off-by: Aline Manera > --- > src/kimchi/root.py | 8 +++++++- > ui/pages/tabs/guests.html.tmpl | 2 +- > 2 files changed, 8 insertions(+), 2 deletions(-) > = > diff --git a/src/kimchi/root.py b/src/kimchi/root.py > index c3d471e..ce4a49c 100644 > --- a/src/kimchi/root.py > +++ b/src/kimchi/root.py > @@ -75,8 +75,14 @@ class Root(Resource): > = > @cherrypy.expose > def tabs(self, page, **kwargs): > + # In order to load the Guests tab, we also use Cheetah in the tab > + # template to save the delay of the extra get to the guest page > + # For that, the tab template needs to know the correct path to u= i files > + data =3D {} > + data['ui_dir'] =3D paths.ui_dir > + > if page.endswith('.html'): > - return template.render('tabs/' + page, None) > + return template.render('tabs/' + page, data) > raise cherrypy.HTTPError(404) > = > = > diff --git a/ui/pages/tabs/guests.html.tmpl b/ui/pages/tabs/guests.html.t= mpl > index e2ab173..8b530c7 100644 > --- a/ui/pages/tabs/guests.html.tmpl > +++ b/ui/pages/tabs/guests.html.tmpl > @@ -52,7 +52,7 @@ > $_("No guests found.") > > >