From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D ...
Date: 30 Jul 2007 05:06:48 -0000 [thread overview]
Message-ID: <20070730050648.950.qmail@sourceware.org> (raw)
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":
next reply other threads:[~2007-07-30 5:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-30 5:06 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-07-27 17:02 [Cluster-devel] conga/luci/site/luci/Extensions/ClusterModel D jparsons
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=20070730050648.950.qmail@sourceware.org \
--to=rmccabe@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 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).