r5624 - trunk/wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-19 20:34:52 +0000 (Wed, 19 Dec 2012)
New Revision: 5624
Modified:
trunk/wooly/python/wooly/table.strings
Log:
Adjustment to compliment the revision 5586 change from render_cell_title to render_title. The strings file was still referencing {cell_title}.
Modified: trunk/wooly/python/wooly/table.strings
===================================================================
--- trunk/wooly/python/wooly/table.strings 2012-12-19 20:17:14 UTC (rev 5623)
+++ trunk/wooly/python/wooly/table.strings 2012-12-19 20:34:52 UTC (rev 5624)
@@ -60,7 +60,7 @@
<th class="{class}">{content}</th>
[TableColumnCell.html]
-<td class="{class}" title="{cell_title}">{content}</td>
+<td class="{class}" title="{title}">{content}</td>
[TableRow.html]
<tr>{cells}</tr>
11 years, 4 months
r5623 - trunk/cumin/python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-19 20:17:14 +0000 (Wed, 19 Dec 2012)
New Revision: 5623
Modified:
trunk/cumin/python/cumin/messaging/connection.py
Log:
Fix for BZ 887174 - Session detail failed. Added a connection reference to SessionSelector so that only the sessions for the selected connection are displayed.
Modified: trunk/cumin/python/cumin/messaging/connection.py
===================================================================
--- trunk/cumin/python/cumin/messaging/connection.py 2012-12-19 19:46:58 UTC (rev 5622)
+++ trunk/cumin/python/cumin/messaging/connection.py 2012-12-19 20:17:14 UTC (rev 5623)
@@ -184,6 +184,7 @@
super(SessionSelector, self).__init__(app, name, cls)
self.conn = conn
+ self.add_reference_filter(self.conn, cls.connectionRef)
frame = "main.messaging.broker.connection.session"
col = ObjectLinkColumn(app, "name", cls.name, cls._id, frame)
11 years, 4 months
r5622 - trunk/cumin/python/cumin
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-19 19:46:58 +0000 (Wed, 19 Dec 2012)
New Revision: 5622
Modified:
trunk/cumin/python/cumin/session.py
Log:
Fix for bug found while fixing BZ 886937 - unable to remove routes.
Added special method to generate route keys
Modified: trunk/cumin/python/cumin/session.py
===================================================================
--- trunk/cumin/python/cumin/session.py 2012-12-19 19:41:03 UTC (rev 5621)
+++ trunk/cumin/python/cumin/session.py 2012-12-19 19:46:58 UTC (rev 5622)
@@ -83,23 +83,7 @@
if obj._qmf_object_id.isdigit():
# Translate v1 object ids
-
- if obj._class is self.app.model.org_apache_qpid_broker.Queue:
- # A very special workaround for queue keys
-
- key = obj.name
- elif obj._class is self.app.model.org_apache_qpid_broker.Link:
- # A very special workaround for link keys
- key = "qpid.%s:%s:%d" % (obj.transport, obj.host, obj.port)
- else:
- key_args = [str(getattr(obj, x.name))
- for x in obj._class._attributes
- if x.index and not x.references]
- key = ",".join(key_args)
-
- id_args = (obj._class._package._name, obj._class._name.lower(), key)
-
- object_id = ":".join(id_args)
+ object_id = self.gen_object_id(obj)
else:
object_id = obj._qmf_object_id
@@ -125,6 +109,40 @@
finally:
self.lock.release()
+ def gen_object_id(self, obj):
+ # special case objects are queue, link , and bridge
+ if obj._class in (self.app.model.org_apache_qpid_broker.Queue,
+ self.app.model.org_apache_qpid_broker.Link,
+ self.app.model.org_apache_qpid_broker.Bridge):
+ if obj._class is self.app.model.org_apache_qpid_broker.Queue:
+ key = obj.name
+ else:
+ if obj._class is self.app.model.org_apache_qpid_broker.Bridge:
+ # bridges need the link object_id as well as their own object_id
+ cls = self.app.model.org_apache_qpid_broker.Link
+ cursor = self.app.database.get_read_cursor()
+ link = cls.get_object(cursor, _id=obj._linkRef_id)
+ if not link:
+ raise Exception("Object '%s' is not a valid bridge" % obj._id)
+ else:
+ link = obj
+ key = "qpid.%s:%s:%d" % (link.transport, link.host, link.port)
+
+ if obj._class is self.app.model.org_apache_qpid_broker.Bridge:
+ #org.apache.qpid.broker:bridge:org.apache.qpid.broker:link:qpid.tcp:localhost:5671,qpid.tcp:localhost:5671!amq.direct!amq.direct!r-key
+ key = "%s:%s:%s,%s!%s!%s!%s" % (link._class._package._name, link._class._name.lower(),
+ key, key, obj.src, obj.dest, obj.key)
+ else:
+ # other objects use the schema index fields
+ key_args = [str(getattr(obj, x.name))
+ for x in obj._class._attributes
+ if x.index and not x.references]
+ key = ",".join(key_args)
+
+ id_args = (obj._class._package._name, obj._class._name.lower(), key)
+ object_id = ":".join(id_args)
+ return object_id
+
def __repr__(self):
uris_without_password = [x[x.rfind("@")+1:] for x in self.broker_uris]
return "%s(%s)" % (self.__class__.__name__, uris_without_password)
11 years, 4 months
r5621 - trunk/cumin/python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-19 19:41:03 +0000 (Wed, 19 Dec 2012)
New Revision: 5621
Modified:
trunk/cumin/python/cumin/messaging/brokerlink.strings
Log:
Remove radio button on route add form
Modified: trunk/cumin/python/cumin/messaging/brokerlink.strings
===================================================================
--- trunk/cumin/python/cumin/messaging/brokerlink.strings 2012-12-19 16:52:29 UTC (rev 5620)
+++ trunk/cumin/python/cumin/messaging/brokerlink.strings 2012-12-19 19:41:03 UTC (rev 5621)
@@ -45,9 +45,14 @@
{sql_where}
[ExchangeRadioField.html]
+<style>
+div.exchangeRadioInputs ul {
+ list-style: none;
+}
+</style>
<tr>
<th>{title}<div class="field_help">{field_help}</div></th>
- <td>{phase} {errors} <div class="inputs">{inputs}</div></td>
+ <td>{phase} {errors} <div class="inputs exchangeRadioInputs">{inputs}</div></td>
</tr>
[BridgeAddHelpField.css]
11 years, 4 months
r5620 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-19 16:52:29 +0000 (Wed, 19 Dec 2012)
New Revision: 5620
Modified:
trunk/cumin/python/cumin/stat.py
Log:
BZ 880675: Changing self.colors to be a list[] rather than a tuple(). tuple won't work on python 2.4.
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-12-19 14:29:54 UTC (rev 5619)
+++ trunk/cumin/python/cumin/stat.py 2012-12-19 16:52:29 UTC (rev 5620)
@@ -808,11 +808,11 @@
return chart.create()
class FlashLineChart(Widget):
- colors = ('#009926','#992600','#0036d6','#ffc414','730099','#ff00cc')
one_day = 24 * 60 * 60
def __init__(self, app, name, page):
super(FlashLineChart, self).__init__(app, name)
self.page = page
+ self.colors = ['#009926','#992600','#0036d6','#ffc414','730099','#ff00cc']
def pos_to_seconds(self, pos):
""" convert the flash chart slider position into a number of seconds ago """
11 years, 4 months
r5619 - trunk/cumin/python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-19 14:29:54 +0000 (Wed, 19 Dec 2012)
New Revision: 5619
Modified:
trunk/cumin/python/cumin/messaging/brokerlink.py
trunk/cumin/python/cumin/messaging/brokerlink.strings
Log:
Fix for BZ 886937 Unable to add a route (bridge) to a link. This is the second half of the fix for this bz. Now using the Rosemary classes for object lookup.
Modified: trunk/cumin/python/cumin/messaging/brokerlink.py
===================================================================
--- trunk/cumin/python/cumin/messaging/brokerlink.py 2012-12-18 19:42:14 UTC (rev 5618)
+++ trunk/cumin/python/cumin/messaging/brokerlink.py 2012-12-19 14:29:54 UTC (rev 5619)
@@ -37,7 +37,8 @@
class BrokerLinkRemoveForm(ObjectFrameTaskForm):
def render_content(self, session):
obj = self.object.get(session)
- return xml_escape(obj.host)
+ content = "%s:%d" % (obj.host, obj.port)
+ return xml_escape(content)
class BrokerLinkRemove(ObjectFrameTask):
def __init__(self, app, frame):
@@ -105,13 +106,21 @@
self.remove = RouteSelectionRemove(app, self)
+ def render_title(self, session):
+ # the table name is Bridges, but we want to call it Routes
+ return "Routes"
+
class RouteSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
- return "Remove"
+ return "Remove Route"
def do_invoke(self, invoc, route):
self.app.remote.qmf.close(route, invoc.make_callback())
+ def get_item_content(self, session, item):
+ name = "%s=>%s (%s)" % (item.src, item.dest, item.key)
+ return xml_escape(name)
+
# XXX RouteFrame
class RouteRemove(ObjectFrameTask):
@@ -174,28 +183,29 @@
link = self.form.link.get(session)
if link is not None:
- vhost = link.vhost
- sortedExchanges = sorted_by(vhost.exchanges)
+ cls = self.app.model.org_apache_qpid_broker.Exchange
+ all_exchanges = cls.get_selection(session.cursor, _vhostRef_id=link._vhostRef_id)
+ sortedExchanges = sorted_by(all_exchanges)
for exchange in sortedExchanges:
if ExchangeInfo.is_builtin(exchange) or \
- (not exchange._get_qmfDeleteTime() and \
+ (not exchange._qmf_delete_time and \
not (self.state.is_active(session) and not is_active(exchange))):
- if not exchange.name in ["qpid.management", ""]:
+ if not exchange.name in ["", "qpid.management", "qmf.default.topic", "qmf.default.direct"]:
if not self.param.get(session):
- self.param.set(session, exchange.id)
+ self.param.set(session, exchange._id)
exchanges.append(exchange)
return exchanges
def render_item_value(self, session, exchange):
- return exchange.id
+ return exchange._id
def render_item_content(self, session, exchange):
return xml_escape(exchange.name)
def render_item_checked_attr(self, session, exchange):
- if self.param.get(session) == exchange.id:
+ if self.param.get(session) == exchange._id:
return "checked=\"checked\""
class ExchangeRadioField(FormField):
@@ -229,6 +239,10 @@
def get_title(self, session):
return "Add route"
+ def do_enter(self, session, osession):
+ link = self.frame.object.get(osession)
+ self.form.link.set(session, link)
+
def do_invoke(self, invoc, link, exchange, key, tag, dynamic, sync,
excludes):
@@ -240,7 +254,8 @@
def __init__(self, app, name, task):
super(RouteAddForm, self).__init__(app, name, task)
- self.link = LinkParameter(app, "link")
+ cls = app.model.org_apache_qpid_broker.Link
+ self.link = RosemaryObjectParameter(app, "link", cls)
self.add_parameter(self.link)
self.exchange = ExchangeRadioField(app, "exchange")
@@ -276,7 +291,7 @@
link = self.link.get(session)
if not self.tag.get(session):
- brokerId = QpidAgentId.fromString(link.qmfAgentId).brokerId
+ brokerId = link._vhostRef_id
self.tag.set(session, brokerId)
if not self.excludes.get(session):
@@ -321,7 +336,8 @@
tag = self.tag.get(session)
excludes = self.excludes.get(session)
exchange_id = self.exchange.get(session)
- exchange = Exchange.get(int(exchange_id))
+ cls = self.app.model.org_apache_qpid_broker.Exchange
+ exchange = cls.get_object(session.cursor, _id=exchange_id)
durable = link.durable
dynamic = self.dynamic.get(session) == "yes"
sync = self.sync.get(session)
Modified: trunk/cumin/python/cumin/messaging/brokerlink.strings
===================================================================
--- trunk/cumin/python/cumin/messaging/brokerlink.strings 2012-12-18 19:42:14 UTC (rev 5618)
+++ trunk/cumin/python/cumin/messaging/brokerlink.strings 2012-12-19 14:29:54 UTC (rev 5619)
@@ -45,12 +45,10 @@
{sql_where}
[ExchangeRadioField.html]
-<div class="{form_field_class}">
- <div class="rfloat">{phase}</div>
- <div class="title">{title}</div> <div class="field_help">{field_help}</div><div class="clear_left"></div>
- {errors}
- <div class="inputs">{inputs}</div><div style="clear:left;"><!-- --></div>
-</div>
+<tr>
+ <th>{title}<div class="field_help">{field_help}</div></th>
+ <td>{phase} {errors} <div class="inputs">{inputs}</div></td>
+</tr>
[BridgeAddHelpField.css]
div#bridge_add_help span.tag1 {
11 years, 4 months
r5618 - trunk/cumin/python/cumin
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-18 19:42:14 +0000 (Tue, 18 Dec 2012)
New Revision: 5618
Modified:
trunk/cumin/python/cumin/session.py
Log:
Fix for 1st half of BZ 886937 - Can't remove broker link. Detect request to construct broker link key, and generate a non-standard key for qmf call.
Modified: trunk/cumin/python/cumin/session.py
===================================================================
--- trunk/cumin/python/cumin/session.py 2012-12-18 18:23:31 UTC (rev 5617)
+++ trunk/cumin/python/cumin/session.py 2012-12-18 19:42:14 UTC (rev 5618)
@@ -88,6 +88,9 @@
# A very special workaround for queue keys
key = obj.name
+ elif obj._class is self.app.model.org_apache_qpid_broker.Link:
+ # A very special workaround for link keys
+ key = "qpid.%s:%s:%d" % (obj.transport, obj.host, obj.port)
else:
key_args = [str(getattr(obj, x.name))
for x in obj._class._attributes
11 years, 4 months
r5617 - branches/elephant/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-18 18:23:31 +0000 (Tue, 18 Dec 2012)
New Revision: 5617
Modified:
branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
Log:
"nice-casing" the value in the State column. RUNNING will now be presented as "Running"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2012-12-18 18:20:52 UTC (rev 5616)
+++ branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2012-12-18 18:23:31 UTC (rev 5617)
@@ -39,7 +39,10 @@
field_data = list()
for column in self.columns:
try:
- val = record[column.name.lower()]
+ if column.name == "State":
+ val = record[column.name.lower()].title()
+ else:
+ val = record[column.name.lower()]
except AttributeError:
if (column.name == "Ipc"):
val = record.ref.ipc
11 years, 4 months
r5616 - trunk/cumin/python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-18 18:20:52 +0000 (Tue, 18 Dec 2012)
New Revision: 5616
Modified:
trunk/cumin/python/cumin/messaging/broker.py
Log:
Fix for BZ 886942 - Duplicate links on acl and cluster pages. Overrode ObjectView class for these and suppressed display of summary section.
Modified: trunk/cumin/python/cumin/messaging/broker.py
===================================================================
--- trunk/cumin/python/cumin/messaging/broker.py 2012-12-18 16:44:13 UTC (rev 5615)
+++ trunk/cumin/python/cumin/messaging/broker.py 2012-12-18 18:20:52 UTC (rev 5616)
@@ -157,6 +157,14 @@
def do_render(self, session):
return "This module is not enabled"
+class BrokerPluginView(ObjectView):
+ def render_context(self, session):
+ pass
+ def render_heading(self, session):
+ pass
+ def render_summary(self, session):
+ pass
+
class BrokerAccessControl(ModeSet):
def __init__(self, app, name, vhost):
super(BrokerAccessControl, self).__init__(app, name)
@@ -169,7 +177,7 @@
mode = ModuleNotEnabled(app, "notenabled")
self.add_mode(mode)
- self.view = ObjectView(app, "view", self.acl)
+ self.view = BrokerPluginView(app, "view", self.acl)
self.add_mode(self.view)
class AclModuleAttribute(Attribute):
@@ -199,7 +207,7 @@
self.notenabled = ModuleNotEnabled(app, "notenabled")
self.add_mode(self.notenabled)
- self.view = ObjectView(app, "view", self.cluster)
+ self.view = BrokerPluginView(app, "view", self.cluster)
self.add_mode(self.view)
class ClusteringModuleAttribute(Attribute):
11 years, 4 months
r5615 - branches/elephant/wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-18 16:44:13 +0000 (Tue, 18 Dec 2012)
New Revision: 5615
Modified:
branches/elephant/wooly/python/wooly/table.py
Log:
fix for title
Modified: branches/elephant/wooly/python/wooly/table.py
===================================================================
--- branches/elephant/wooly/python/wooly/table.py 2012-12-18 14:39:40 UTC (rev 5614)
+++ branches/elephant/wooly/python/wooly/table.py 2012-12-18 16:44:13 UTC (rev 5615)
@@ -261,7 +261,7 @@
def render_content(self, session, record):
return self.parent.do_render_cell_content(session, record)
- def render_title(self, session, record):
+ def render_cell_title(self, session, record):
#gives us the title="" attribute for each table cell
return self.parent.do_render_cell_title(session, record)
11 years, 4 months