Skip to contentSkip to conversation

conga/luci/site/luci/Extensions FenceHandler.p ...

Cluster-devel [email protected] 1 participant 1 message Oct 3, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-10-03 19:40:37

Modified files:
luci/site/luci/Extensions: FenceHandler.py luci/site/luci/Extensions/ClusterModel: Device.py FenceDevice.py
FenceDeviceAttr.py ModelBuilder.py

Log message:
Fix a bug that caused the check for dual power fencing to fail when adding new fence instances for the first time.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/Device.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDevice.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&r1=1.11&r2=1.12

luci/site/luci/Extensions/FenceHandler.py +1 -0
@@ -1077,6 +1077,7 @@
 
 	fenceinst = Device()
 	fenceinst.addAttribute('name', parent_name)
+	fenceinst.setAgentType(fence_agent)
 
 	if form.has_key('option'):
 		option = form['option'].strip()
luci/site/luci/Extensions/ClusterModel/Device.py +1 -5
@@ -31,11 +31,7 @@
     return self.has_native_option_set
 
   def isPowerController(self):
-    for item in FenceDeviceAttr.FENCE_POWER_CONTROLLERS:
-      if self.agent_type == item:
-        return True
-
-    return False
+    return self.agent_type in FenceDeviceAttr.FENCE_POWER_CONTROLLERS
 
   def addAttribute(self, name, value):
     if name == OPTION:
luci/site/luci/Extensions/ClusterModel/FenceDevice.py +6 -6
@@ -29,7 +29,11 @@
     return agent
 
   def getPrettyName(self):
-    return self.pretty_fence_names[self.attr_hash['name']]
+    agent_type = self.getAgentType()
+    pname = self.pretty_fence_names.get(agent_type)
+    if pname is None:
+      pname = agent_type
+    return pname
 
   def isShared(self):
     agent = self.getAgentType()
@@ -39,8 +43,4 @@
         return False
       else:
         return True
-
-    try:
-      return self.shared_fences[agent]
-    except KeyError, e:
-      return False
+    return self.shared_fences.has_key(agent)
luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py +41 -37

109 lines not on this page · raw message

luci/site/luci/Extensions/ClusterModel/ModelBuilder.py +33 -41

94 lines not on this page · raw message