* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D ...
@ 2007-07-27 17:02 jparsons
0 siblings, 0 replies; 2+ messages in thread
From: jparsons @ 2007-07-27 17:02 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: jparsons at sourceware.org 2007-07-27 17:02:35
Modified files:
luci/site/luci/Extensions/ClusterModel: Device.py
ModelBuilder.py
Log message:
Part of fix for bz249066
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/Device.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.4&r2=1.5
--- conga/luci/site/luci/Extensions/ClusterModel/Device.py 2007/06/25 16:03:39 1.2
+++ conga/luci/site/luci/Extensions/ClusterModel/Device.py 2007/07/27 17:02:35 1.3
@@ -9,16 +9,18 @@
from TagObject import TagObject
TAG_NAME = "device"
+OPTION = "option"
#New Power Controller Fence Agent names should be added to
#the list below
-power_controller_list = ["fence_wti", "fence_apc"]
+power_controller_list = ["fence_wti", "fence_apc","fence_apc_snmp"]
class Device(TagObject):
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
self.agent_type = ""
+ self.has_native_option_set = False
self.fi_attrs = FenceHandler.FENCE_FI_ATTRS
self.pretty_fence_names = FenceHandler.FENCE_OPTS
self.pretty_name_attrs = FenceHandler.PRETTY_NAME_ATTRS
@@ -29,9 +31,17 @@
def setAgentType(self, agent_type):
self.agent_type = agent_type
+ def hasNativeOptionSet(self):
+ return self.has_native_option_set
+
def isPowerController(self):
for item in power_controller_list:
if self.agent_type == item:
return True
return False
+
+ def addAttribute(self, name, value):
+ if name == OPTION:
+ self.has_native_option_set = True
+ self.attr_hash[name] = value
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2007/07/03 17:06:00 1.4
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2007/07/27 17:02:35 1.5
@@ -1090,6 +1090,8 @@
kids = level.getChildren()
l = list()
for kid in kids:
+ if kid.hasNativeOptionSet() == True:
+ continue
if kid.isPowerController() is True:
l.append(kid)
if len(l) > 1: #Means we found multiple PCs in the same level
@@ -1116,6 +1118,13 @@
for level in levels:
kids = level.getChildren()
for kid in kids: #kids are actual fence instance objects
+ #Need to pass over this device if:
+ ##1) It is not a power controller, or
+ ##2) It had an initial option attr when the model was constructed
+ if not kid.isPowerController():
+ continue
+ if kid.hasNativeOptionSet():
+ continue
res = kid.getAttribute("option")
if res is not None:
if res == "off":
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D ...
@ 2007-07-30 5:06 rmccabe
0 siblings, 0 replies; 2+ messages in thread
From: rmccabe @ 2007-07-30 5:06 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-07-30 05:06:47
Modified files:
luci/site/luci/Extensions/ClusterModel: Device.py
ModelBuilder.py
Log message:
Fixes for 249086 from HEAD
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/Device.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.1&r2=1.1.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.3&r2=1.1.4.4
--- conga/luci/site/luci/Extensions/ClusterModel/Device.py 2007/06/18 18:39:33 1.1.4.1
+++ conga/luci/site/luci/Extensions/ClusterModel/Device.py 2007/07/30 05:06:47 1.1.4.2
@@ -9,16 +9,18 @@
from TagObject import TagObject
TAG_NAME = "device"
+OPTION = "option"
#New Power Controller Fence Agent names should be added to
#the list below
-power_controller_list = ["fence_wti", "fence_apc"]
+power_controller_list = [ "fence_wti", "fence_apc", "fence_apc_snmp" ]
class Device(TagObject):
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
self.agent_type = ""
+ self.has_native_option_set = False
self.fi_attrs = FenceHandler.FENCE_FI_ATTRS
self.pretty_fence_names = FenceHandler.FENCE_OPTS
self.pretty_name_attrs = FenceHandler.PRETTY_NAME_ATTRS
@@ -29,9 +31,17 @@
def setAgentType(self, agent_type):
self.agent_type = agent_type
+ def hasNativeOptionSet(self):
+ return self.has_native_option_set
+
def isPowerController(self):
for item in power_controller_list:
if self.agent_type == item:
return True
return False
+
+ def addAttribute(self, name, value):
+ if name == OPTION:
+ self.has_native_option_set = True
+ self.attr_hash[name] = value
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2007/07/26 05:57:42 1.1.4.3
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2007/07/30 05:06:47 1.1.4.4
@@ -1090,6 +1090,8 @@
kids = level.getChildren()
l = list()
for kid in kids:
+ if kid.hasNativeOptionSet() == True:
+ continue
if kid.isPowerController() is True:
l.append(kid)
if len(l) > 1: #Means we found multiple PCs in the same level
@@ -1116,6 +1118,13 @@
for level in levels:
kids = level.getChildren()
for kid in kids: #kids are actual fence instance objects
+ #Need to pass over this device if:
+ ##1) It is not a power controller, or
+ ##2) It had an initial option attr when the model was constructed
+ if not kid.isPowerController():
+ continue
+ if kid.hasNativeOptionSet():
+ continue
res = kid.getAttribute("option")
if res is not None:
if res == "off":
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-30 5:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30 5:06 [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D rmccabe
-- strict thread matches above, loose matches on Subject: below --
2007-07-27 17:02 jparsons
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).