From: jparsons@sourceware.org <jparsons@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D ...
Date: 27 Jul 2007 17:02:35 -0000 [thread overview]
Message-ID: <20070727170235.4843.qmail@sourceware.org> (raw)
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":
next reply other threads:[~2007-07-27 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 17:02 jparsons [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-07-30 5:06 [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D 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=20070727170235.4843.qmail@sourceware.org \
--to=jparsons@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.