@cherrypy.expose
@cherrypy.tools.mako(filename="/unauth.mako")
def index(self):
- d = dict(simple=True)
- if os.path.exists("/etc/invirt/message"):
- f = open('/etc/invirt/message')
- d['serviceMessage']= f.read()
- return d
+ return dict(simple=True)
class InvirtWeb(View):
def __init__(self):
olddisk = {}
session.begin()
try:
- kws = dict([(kw, fields[kw]) for kw in
+ kws = dict((kw, fields[kw]) for kw in
'owner admin contact name description memory vmtype disksize'.split()
- if fields[kw]])
+ if fields.get(kw))
kws['machine_id'] = machine_id
validate = validation.Validate(username, state, **kws)
machine = validate.machine