commit 6f2ff20598599763580e6f12605ad408e8108c9c
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Oct 22 00:29:30 2010 -0400
Add setters and getters for the attributes of the altname element
luci/lib/ClusterConf/Altname.py | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Altname.py b/luci/lib/ClusterConf/Altname.py
index 8474afd..48bb221 100644
--- a/luci/lib/ClusterConf/Altname.py
+++ b/luci/lib/ClusterConf/Altname.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2009 Red Hat, Inc.
+# Copyright (C) 2007-2010 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -13,3 +13,21 @@ class Altname(TagObject):
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
+
+ def getAddr(self):
+ return self.attr_hash.get('name')
+
+ def setAddr(self, val):
+ return self.addAttribute('name', val)
+
+ def getPort(self):
+ return self.getAttribute('port')
+
+ def setPort(self, val):
+ return self.addIntegerAttribute('port', val, (1, 0xffff))
+
+ def getMcast(self):
+ return self.getAttribute('mcast')
+
+ def setMcast(self, val):
+ return self.addAttribute('mcast', val)
Show replies by date