Skip to contentSkip to conversation

conga/luci cluster/form-macros site/luci/Exten ...

Cluster-devel [email protected] 1 participant 1 message Dec 6, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-12-06 22:11:20

Modified files:
luci/cluster : form-macros
luci/site/luci/Extensions: cluster_adapters.py

Log message:
- Fix an IP corner case for setting/editing services
- Fix the autostart setting and its display

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.174&r2=1.175

luci/cluster/form-macros +1 -1
@@ -2825,7 +2825,7 @@
 							This service is stopped
 						</tal:block>
 					</div>
-					<p>Autostart is <span tal:condition="not: autostart" tal:replace="string:not" /> enabled for this service</p>
+					<p>Autostart is <span tal:condition="python: autostart.lower() == 'false'" tal:replace="string:not" /> enabled for this service</p>
 				</td>
 			</tr>
 
luci/site/luci/Extensions/cluster_adapters.py +8 -1
@@ -468,6 +468,13 @@
 			return (False, {'errors': [ 'An invalid resource type was specified' ]})
 
 		try:
+			if res_type == 'ip':
+				dummy_form['resourceName'] = dummy_form['ip_address']
+		except Exception, e:
+			luci_log.debug_verbose('vSA3a: type is ip but no addr: %s' % str(e))
+			return (False, {'errors': [ 'No IP address was given.' ]})
+
+		try:
 			if dummy_form.has_key('immutable'):
 				newRes = getResource(model, dummy_form['resourceName'])
 				resObj = RefObject(newRes)
@@ -493,7 +500,7 @@
 
 	autostart = "1"
 	try:
-		if not request.form.has_key('autostart'):
+		if request.form['autostart'] == "0":
 			autostart = "0"
 	except:
 		pass