From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/site/luci/Extensions LuciValidation.py
Date: 5 Aug 2010 19:32:59 -0000 [thread overview]
Message-ID: <20100805193259.21081.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2010-08-05 19:32:58
Modified files:
luci/site/luci/Extensions: LuciValidation.py
Log message:
Fix rhbz#603114: Can't create KVM guest resources without a path to the XML file
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.13&r2=1.6.2.14
--- conga/luci/site/luci/Extensions/LuciValidation.py 2010/01/07 18:08:35 1.6.2.13
+++ conga/luci/site/luci/Extensions/LuciValidation.py 2010/08/05 19:32:58 1.6.2.14
@@ -1116,10 +1116,6 @@
errors.append('No virtual machine name was given')
vm_path = fvar['vmpath']
- if vm_path is None:
- if LUCI_DEBUG_MODE is True:
- luci_log.debug_verbose('validateVM3: no vm path')
- errors.append('No path to the virtual machine configuration directory was given for VM service "%s"' % vm_name)
autostart = 1
if request.form.has_key('autostart'):
@@ -1192,7 +1188,8 @@
if isNew is True:
xvm = Vm()
xvm.addAttribute('name', vm_name)
- xvm.addAttribute('path', vm_path)
+ if vm_path:
+ xvm.addAttribute('path', vm_path)
rmptr = model.getResourceManagerPtr()
rmptr.addChild(xvm)
else:
@@ -1203,7 +1200,11 @@
except:
return (False, { 'errors': [ 'No virtual machine service named "%s" exists' % old_name ]})
xvm.addAttribute('name', vm_name)
- xvm.addAttribute('path', vm_path)
+
+ if vm_path:
+ xvm.addAttribute('path', vm_path)
+ else:
+ xvm.removeAttribute('vm_path')
if nfslock is not None:
xvm.addAttribute('nfslock', '1')
@@ -1229,6 +1230,8 @@
hypervisor = fvar['hypervisor']
if hypervisor == 'xen':
xvm.addAttribute('hypervisor', 'xen')
+ if not vm_path:
+ errors.append('No path to the virtual machine configuration directory was given for VM service "%s"' % vm_name)
elif hypervisor == 'qemu':
xvm.addAttribute('hypervisor', 'qemu')
else:
@@ -1264,6 +1267,8 @@
action = VM_CONFIG
status_msg = 'Configuring virtual machine service "%s"' % vm_name
+ if len(errors) > 0:
+ return (False, {'errors': errors })
return (True, { 'action_type': action, 'action_msg': status_msg })
def validate_fence_del(model, request):
next reply other threads:[~2010-08-05 19:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 19:32 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-07-31 18:46 [Cluster-devel] conga/luci/site/luci/Extensions LuciValidation.py rmccabe
2007-12-12 15:43 rmccabe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100805193259.21081.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).