FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-17-2008, 03:36 PM
 
Default conga/luci/site/luci/Extensions LuciValidation ...

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe@sourceware.org 2008-01-17 16:36:31

Modified files:
luci/site/luci/Extensions: LuciValidation.py FenceHandler.py
luci/site/luci/Extensions/ClusterModel: FenceDeviceAttr.py

Log message:
fix 238655

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.3&r2=1 .4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&r1=1.29&r2=1. 30
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py.diff?cvsroot=cluster&r1=1.4&r2= 1.5

--- conga/luci/site/luci/Extensions/LuciValidation.py 2008/01/15 04:41:40 1.3
+++ conga/luci/site/luci/Extensions/LuciValidation.py 2008/01/17 16:36:30 1.4
@@ -217,7 +217,7 @@

# Add back the tags under the method block
# for the fence instance
- if type == 'fence_manual':
+ if fence_type == 'fence_manual':
instance_list.append({'name': fencedev_name, 'nodename': nodename })
else:
instance_list.append({'name': fencedev_name })
@@ -234,7 +234,7 @@
# so the appropriate XML goes into the <method> block inside
# <node><fence>. All we need for that is the device name.
if not fence_form.has_key('sharable'):
- if type == 'fence_manual':
+ if fence_type == 'fence_manual':
instance_list.append({'name': fencedev_name, 'nodename': nodename })
else:
instance_list.append({'name': fencedev_name })
--- conga/luci/site/luci/Extensions/FenceHandler.py 2008/01/02 21:00:31 1.29
+++ conga/luci/site/luci/Extensions/FenceHandler.py 2008/01/17 16:36:30 1.30
@@ -1055,6 +1055,12 @@

return errors

+def val_manual_fi(form, fenceinst):
+ nodename = form.get('nodename')
+ if nodename:
+ fenceinst.addAttribute('nodename', nodename)
+ return []
+
def val_noop_fi(dummy, _dummy):
return []

@@ -1069,14 +1075,14 @@
'fence_mcdata': val_mcdata_fi,
'fence_egenera': val_egenera_fi,
'fence_bullpap': val_bullpap_fi,
+ 'fence_manual': val_manual_fi,
'fence_xvm': val_xvm_fi,
'fence_scsi': val_scsi_fi,
'fence_ilo': val_noop_fi,
'fence_ipmilan': val_noop_fi,
'fence_drac': val_noop_fi,
'fence_rsa': val_noop_fi,
- 'fence_rps10': val_noop_fi,
- 'fence_manual': val_noop_fi
+ 'fence_rps10': val_noop_fi
}

def validate_fenceinstance(form, parent_name, fence_agent):
--- conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py 2008/01/02 20:56:08 1.4
+++ conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py 2008/01/17 16:36:30 1.5
@@ -130,5 +130,5 @@
'fence_rps10':
( 'name', 'device', 'port' ),
'fence_manual':
- ( 'name' )
+ ( 'name', 'nodename' )
}
 
Old 02-05-2008, 05:26 PM
 
Default conga/luci/site/luci/Extensions LuciValidation ...

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe@sourceware.org 2008-02-05 18:26:55

Modified files:
luci/site/luci/Extensions: LuciValidation.py
luci/site/luci/Extensions/ClusterModel: ClusterNode.py
ModelBuilder.py

Log message:
Fix a bug that caused fence method blocks to be added inside the first child tag of cluster nodes (which need not be <fence>).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.6&r2=1 .7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&r1=1.15&r2=1. 16

--- conga/luci/site/luci/Extensions/LuciValidation.py 2008/01/23 04:34:09 1.6
+++ conga/luci/site/luci/Extensions/LuciValidation.py 2008/02/05 18:26:54 1.7
@@ -81,12 +81,12 @@

levels = node.getFenceLevels()
try:
- method_id = levels[fence_level - 1].getAttribute('name')
+ method_id = levels[min(1, fence_level - 1)].getAttribute('name')
if not method_id:
raise Exception, 'No method ID'
fence_method = Method()
fence_method.addAttribute('name', str(method_id))
- levels[fence_level - 1] = fence_method
+ levels[min(1, fence_level - 1)] = fence_method
except Exception, e:
method_id = fence_level
fence_method = Method()
@@ -102,7 +102,7 @@
break
if delete_target is not None:
try:
- node.getChildren()[0].removeChild(delete_target)
+ node.getFenceNode().removeChild(delete_target)
except Exception, e:
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('vNFC9: %s: %r %s'
@@ -251,23 +251,17 @@
continue
fence_method.addChild(retobj)

- if len(node.getChildren()) > 0:
- # There's already a <fence> block
- found_target = False
- for idx in xrange(len(levels)):
- if levels[idx].getAttribute('name') == method_id:
- found_target = True
- break
-
- if found_target is False:
- # There's a fence block, but no relevant method
- # block
- node.getChildren()[0].addChild(fence_method)
- else:
- # There is no <fence> tag under the node yet.
- fence_node = Fence()
+ fence_node = node.getFenceNode()
+ found_target = False
+ for idx in xrange(len(levels)):
+ if levels[idx].getAttribute('name') == method_id:
+ found_target = True
+ break
+
+ if found_target is False:
+ # There's a fence block, but no relevant method
+ # block
fence_node.addChild(fence_method)
- node.addChild(fence_node)

if len(errors) > 0:
return (False, {'errors': errors })
--- conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py 2008/01/02 20:56:08 1.4
+++ conga/luci/site/luci/Extensions/ClusterModel/ClusterNode.py 2008/02/05 18:26:55 1.5
@@ -6,6 +6,7 @@
# Free Software Foundation.

from TagObject import TagObject
+from Fence import Fence

TAG_NAME = "clusternode"

@@ -14,16 +15,21 @@
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME

+ def getFenceNode(self):
+ ret = None
+ for child in self.getChildren():
+ if child.getTagName() == 'fence':
+ ret = child
+ break
+ if ret is None:
+ ret = Fence()
+ self.addChild(ret)
+ return ret
+
def getFenceLevels(self):
- #under this node will be a 'fence' block, then 0 or more 'method' blocks.
- #This method returns the set of 'method' objs. 'method' blocks represent
- #fence levels
- child = self.getChildren()
- if len(child) > 0:
- return child[0].getChildren()
- else:
- retval = list()
- return retval
+ # This method returns the set of 'method' objs. 'method' blocks represent
+ # fence levels
+ return self.getFenceNode().getChildren()

def getMulticastNode(self):
children = self.getChildren()
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/01/15 04:41:40 1.15
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/02/05 18:26:55 1.16
@@ -981,13 +981,6 @@
mcast = self.mcast_ptr

mcast.addAttribute('addr', mcast_addr)
- if mcast_if is not None:
- mcast.addAttribute('interface', mcast_if)
- else:
- try:
- mcast.removeAttribute('interface')
- except:
- pass
self.mcast_address = mcast_addr
self.mcast_interface = mcast_if
self.usesMulticast = True
 

Thread Tools




All times are GMT. The time now is 01:02 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org