osuosl / ganeti_webmgr

Ganeti Web Manager is a Django based web application that allows administrators and clients access to their ganeti clusters. It includes a permissions and quota system that allows administrators to grant access to both clusters and virtual machines. It also includes user groups for structuring access to organizations.
https://code.osuosl.org/projects/ganeti-webmgr
GNU General Public License v2.0
64 stars 32 forks source link

Wrong OS shown when OS is "noop" #53

Open tschuy opened 9 years ago

tschuy commented 9 years ago

From Chance Zibolski

Originally from: https://groups.google.com/forum/#!topic/ganeti-webmgr/X9pDeC2NDOo

I'm testing 0.11.0rc1 under debian wheezy, pointing to ganeti 2.11.5

(1) For instances with operating system "noop", ganeti web manager displays them as "Unknown or invalid OS"

However it seems perfectly valid to me:

root@nuc1:~# gnt-os list Name debootstrap+default debootstrap+precise image+cd image+default noop snf-image+default snf-image+trusty snf-image+wheezy root@nuc1:~# gnt-instance list | grep noop host87.ws.nsrc.org kvm noop nuc2.ws.nsrc.org running 1.0G windows0 kvm noop nuc1.ws.nsrc.org running 1.5G

(this is ganeti-os-noop from grnet)

When creating a new instance, this OS appears under heading "Unknown" as variant "noop". So it appears that it's just having problems with OS definitions with no variants.

candlerb commented 8 years ago

I just saw exactly the same with 0.11.1. I fixed the display of instances like this:

--- ganeti_web/templatetags/webmgr_tags.py.orig 2016-01-29 05:32:15.000000000 +0200
+++ ganeti_web/templatetags/webmgr_tags.py  2016-01-29 05:33:19.000000000 +0200
@@ -477,7 +477,7 @@
         flavor = " ".join(i.capitalize() for i in flavor.split("-"))
         return mark_safe("%s (<em>%s</em>)" % (flavor, t))
     except ValueError:
-        return mark_safe(_("<em>Unknown or invalid OS</em>"))
+        return mark_safe("<em>%s</em>" % os)

 @register.filter

(path relative to /opt/ganeti_webmgr/lib/python2.7/site-packages/ganeti_webmgr after installation)

However I did not look at the way it is rendered the selection when creating a new instance.