Remove annoying update message
[handlervirt.git] / ModuleVirt.py
blob7ad8c53774f940d6bbfed3ee61851c244d4dc802
1 from Form import *
2 from Table import *
3 from Module import *
4 from validations import *
6 NOTE_AUTHENTICATE = 'Use authentication when a request is made.'
7 NOTE_READ_ONLY = 'Only connect to libvirt using a readonly connection.'
8 NOTE_SERVICE_TYPE = 'What service type should we browse on the network for.'
10 class ModuleVirtBase (Module, FormHelper):
11 PROPERTIES = [
12 'service_type',
13 'authenticate'
14 'read_only'
17 def __init__ (self, cfg, prefix, name, submit_url):
18 FormHelper.__init__ (self, name, cfg)
19 Module.__init__ (self, name, cfg, prefix, submit_url)
21 def _op_render (self):
22 txt = "<h2>Libvirt options</h2>"
24 table = TableProps()
25 self.AddPropEntry (table, "mDNS Service Type", "%s!service_type" % (self._prefix), NOTE_SERVICE_TYPE)
26 self.AddPropCheck (table, "Authenticate", "%s!authenticate" % (self._prefix), True, NOTE_AUTHENTICATE)
27 self.AddPropCheck (table, "Read Only", "%s!read_only" % (self._prefix), True, NOTE_READ_ONLY)
28 txt += self.Indent(table)
30 return txt
32 def _op_apply_changes (self, uri, post):
33 checkboxes = ['authenticate', 'read_only']
34 self.ApplyChangesPrefix (self._prefix, checkboxes, post)
37 class ModuleVirt (ModuleVirtBase):
38 def __init__ (self, cfg, prefix, submit_url):
39 ModuleVirtBase.__init__ (self, cfg, prefix, 'virt', submit_url)
41 def _op_render (self):
42 return ModuleVirtBase._op_render (self)
44 def _op_apply_changes (self, uri, post):
45 return ModuleVirtBase._op_apply_changes (self, uri, post)