rhmessaging commits: r4266 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-09 09:34:55 -0400 (Thu, 09 Sep 2010)
New Revision: 4266
Modified:
mgmt/newdata/cumin/python/cumin/model.py
mgmt/newdata/cumin/python/cumin/stat.py
Log:
Fix BZ 630925 - Flash fullpage history slider doesn't work. Also fixed a problem introduced in all flash charts with the new agent parameter. When it contained colons, open-flash-chart would reject it as an invalid URL.
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-09-09 13:17:03 UTC (rev 4265)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-09-09 13:34:55 UTC (rev 4266)
@@ -496,7 +496,8 @@
when2 = ""
if secs2:
when2 = "now() - interval '%i seconds'" % int(secs2)
- SqlComparisonFilter(self.query, updated_col, when2, "<=")
+ filter = SqlComparisonFilter(updated_col, when2, "<=")
+ self.query.add_filter(filter)
options = SqlQueryOptions()
options.sort_column = "interval_end"
Modified: mgmt/newdata/cumin/python/cumin/stat.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/stat.py 2010-09-09 13:17:03 UTC (rev 4265)
+++ mgmt/newdata/cumin/python/cumin/stat.py 2010-09-09 13:34:55 UTC (rev 4266)
@@ -108,8 +108,11 @@
object = self.object.get(session)
params = list()
- params.append("agent=%s" % object._qmf_agent_id)
- params.append("object=%s" % object._qmf_object_id)
+ # open-flash-chart can't handle the : in the agent id. Net even if
+ # it's converted to %3A, so we have to change it
+ params.append("agent=%s" % object._qmf_agent_id.replace(":", "|"))
+
+ params.append("object_id=%s" % object._qmf_object_id)
params.append("chart_id=%s" % self.render_id(session, None))
params.append("duration=%s" % self.duration.get(session))
params.append("rpkg=%s" % object._class._package._name)
@@ -128,7 +131,7 @@
def render_href(self, session):
params = self.get_href_params(session)
- return "%s?" % self.get_chart_name(session) + ";".join(params)
+ return escape_entity("%s?" % self.get_chart_name(session) + ";".join(params))
def get_chart_name(self, session):
return "stats.png"
@@ -179,7 +182,7 @@
def render_fullpage_href(self, session):
params = self.get_href_params(session)
- return "flashpage.html?" + ";".join(params)
+ return escape_entity("flashpage.html?" + ";".join(params))
def render_width(self, session):
return 360
@@ -234,10 +237,10 @@
self.rosemary_package = Parameter(app, "rpkg")
self.add_parameter(self.rosemary_package)
- self.agent_id = StringParameter(app, "agent")
+ self.agent_id = ModifiedAgentIdParameter(app, "agent")
self.add_parameter(self.agent_id)
- self.object_id = StringParameter(app, "object")
+ self.object_id = StringParameter(app, "object_id")
self.add_parameter(self.object_id)
param = Parameter(app, "param")
@@ -459,6 +462,11 @@
chart.write(writer)
return writer.to_string()
+class ModifiedAgentIdParameter(StringParameter):
+ def get(self, session):
+ agent = super(ModifiedAgentIdParameter, self).get(session)
+ return agent.replace("|", ":")
+
class FlashFullPage(HtmlPage):
def __init__(self, app, name):
super(FlashFullPage, self).__init__(app, name)
@@ -467,8 +475,8 @@
self.updater.update_enabled = True
self.add_child(self.updater)
- self.id = IntegerParameter(app, "id")
- self.add_parameter(self.id)
+ self.object_id = StringParameter(app, "object_id")
+ self.add_parameter(self.object_id)
self.rosemary_class = Parameter(app, "rcls")
self.add_parameter(self.rosemary_class)
@@ -480,8 +488,6 @@
self.add_attribute(self.object)
param = Parameter(app, "param")
- self.add_parameter(param)
-
self.stats = ListParameter(app, "stat", param)
self.add_parameter(self.stats)
@@ -517,12 +523,14 @@
rosemary_package = self.app.model._packages_by_name[rpackage]
rosemary_class = rosemary_package._classes_by_name[rclass]
- id = self.widget.id.get(session)
+ object_id = self.widget.object_id.get(session)
+ #id = self.widget.id.get(session)
conn = self.app.database.get_connection()
cursor = conn.cursor()
try:
- obj = rosemary_class.get_object_by_id(cursor, id)
+ obj = rosemary_class.get_object(cursor, _qmf_object_id=object_id)
+ #obj = rosemary_class.get_object_by_id(cursor, id)
finally:
cursor.close()
@@ -541,7 +549,7 @@
params = self.get_href_params(session)
params.append("width=%i" % self.render_width(session))
params.append("height=%i" % self.render_height(session))
- return "%s?" % self.get_chart_name(session) + ";".join(params)
+ return escape_entity("%s?" % self.get_chart_name(session) + ";".join(params))
def render_href(self, session):
params = self.get_href_params(session)
14 years, 3 months
rhmessaging commits: r4265 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-09 09:17:03 -0400 (Thu, 09 Sep 2010)
New Revision: 4265
Modified:
mgmt/newdata/cumin/python/cumin/grid/slot.strings
Log:
Fix css warning
Modified: mgmt/newdata/cumin/python/cumin/grid/slot.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/slot.strings 2010-09-09 13:14:51 UTC (rev 4264)
+++ mgmt/newdata/cumin/python/cumin/grid/slot.strings 2010-09-09 13:17:03 UTC (rev 4265)
@@ -881,11 +881,6 @@
}
div#slot_zooming {
-/* width: 400px;
- height: 400px;
- position: absolute;
- left:0;
- top:0; */
margin: 3em auto;
padding: 1em;
z-index:200;
@@ -893,7 +888,6 @@
background-color: white;
overflow: hidden;
opacity: 0.5;
- -moz-opacity: 0.5;
display: none;
border: 1px solid #000;
}
14 years, 3 months
rhmessaging commits: r4264 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-09 09:14:51 -0400 (Thu, 09 Sep 2010)
New Revision: 4264
Modified:
mgmt/newdata/cumin/python/cumin/widgets.strings
Log:
Fix css warning
Modified: mgmt/newdata/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-08 20:28:07 UTC (rev 4263)
+++ mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-09 13:14:51 UTC (rev 4264)
@@ -155,7 +155,7 @@
<div id="body">
{tasks}
- <div id="messages" style="display: {action_display};"><p title="close" onclick="cumin.hideActions()">x</p>{actions}</div>
+ <div id="messages" style="display: none;"><p title="close" onclick="cumin.hideActions()">x</p>{actions}</div>
{heartbeat}
14 years, 3 months
rhmessaging commits: r4263 - mgmt/newdata/cumin/python/cumin/account.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-08 16:28:07 -0400 (Wed, 08 Sep 2010)
New Revision: 4263
Modified:
mgmt/newdata/cumin/python/cumin/account/widgets.py
Log:
For bz 631694, resync the login session's user to the database before checking the password
Modified: mgmt/newdata/cumin/python/cumin/account/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/account/widgets.py 2010-09-08 18:56:41 UTC (rev 4262)
+++ mgmt/newdata/cumin/python/cumin/account/widgets.py 2010-09-08 20:28:07 UTC (rev 4263)
@@ -183,6 +183,12 @@
new1 = self.new1.get(session)
user = session.client_session.attributes["login_session"].user
+
+ # In case a different login session for this user has made
+ # changes, refresh the user object
+
+ user.load(session.cursor)
+
crypted = user.password
if crypt_password(current, crypted) != crypted:
14 years, 3 months
rhmessaging commits: r4262 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-08 14:56:41 -0400 (Wed, 08 Sep 2010)
New Revision: 4262
Modified:
mgmt/newdata/cumin/python/cumin/grid/job.strings
Log:
Fix css color values
Modified: mgmt/newdata/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.strings 2010-09-08 17:42:12 UTC (rev 4261)
+++ mgmt/newdata/cumin/python/cumin/grid/job.strings 2010-09-08 18:56:41 UTC (rev 4262)
@@ -26,9 +26,9 @@
div.ads_error {
margin: 1em;
padding: 1em;
- background-color: FFEEEE;
+ background-color: #FFEEEE;
border: 1px solid red;
- color: 660000;
+ color: #660000;
}
[JobAdsGroups.html]
14 years, 3 months
rhmessaging commits: r4261 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-08 13:42:12 -0400 (Wed, 08 Sep 2010)
New Revision: 4261
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Remove an unnecessary stringify
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-09-07 22:27:32 UTC (rev 4260)
+++ mgmt/newdata/mint/python/mint/update.py 2010-09-08 17:42:12 UTC (rev 4261)
@@ -239,7 +239,7 @@
agent.objects_by_id[obj_id] = obj
def get_agent_id(self):
- return str(self.qmf_object.getObjectId().agentName)
+ return self.qmf_object.getObjectId().agentName
def get_class(self):
class_key = self.qmf_object.getClassKey()
14 years, 3 months
rhmessaging commits: r4260 - mgmt/newdata/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-07 18:27:32 -0400 (Tue, 07 Sep 2010)
New Revision: 4260
Modified:
mgmt/newdata/cumin/python/cumin/messaging/connection.py
Log:
Fix for BZ 630853. Now using app.session.qmf_brokers
Modified: mgmt/newdata/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-09-07 20:40:00 UTC (rev 4259)
+++ mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-09-07 22:27:32 UTC (rev 4260)
@@ -40,15 +40,15 @@
def do_invoke(self, invoc, conn):
# XXX generalize this check and use it for other closes
- session_ids = set()
+ mgmt_conns = set()
- for broker in self.app.model.mint.model.qmf_brokers:
- session_ids.add(broker.getSessionId())
+ for broker in self.app.session.qmf_brokers:
+ # str(broker.conn) gets the broker.conn.sock host:port
+ mgmt_conns.add(str(broker.conn))
- for sess in conn.sessions:
- if sess.name in session_ids:
- raise Exception \
- ("Cannot close management connection %s" % conn.address)
+ if conn.address in mgmt_conns:
+ raise Exception \
+ ("Cannot close management connection %s" % conn.address)
self.qmf_call(invoc, conn, "close")
@@ -83,20 +83,22 @@
def do_invoke(self, invoc, conn):
# XXX generalize this check and use it for other closes
- session_ids = set()
+ mgmt_conns = set()
- for broker in self.app.model.mint.model.qmf_brokers:
- session_ids.add(broker.getSessionId())
+ for broker in self.app.session.qmf_brokers:
+ # str(broker.conn) gets the broker.conn.sock host:port
+ mgmt_conns.add(str(broker.conn))
- for sess in conn.sessions:
- if sess.name in session_ids:
- raise Exception \
- ("Cannot close management connection %s" % conn.address)
+ if conn.address in mgmt_conns:
+ raise Exception \
+ ("Cannot close management connection %s" % conn.address)
self.qmf_call(invoc, conn, "close")
def get_item_content(self, session, item):
args = (item.remoteProcessName, item.remotePid)
+ if args[1] is None:
+ return item.address
return "%s (%i)" % args
class ConnectionProcessColumn(ObjectTableColumn):
14 years, 3 months
rhmessaging commits: r4259 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-07 16:40:00 -0400 (Tue, 07 Sep 2010)
New Revision: 4259
Modified:
mgmt/newdata/cumin/python/cumin/widgets.strings
Log:
Style tweak to fix top-level tab appearance in webkit browsers
Modified: mgmt/newdata/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-07 16:31:55 UTC (rev 4258)
+++ mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-07 20:40:00 UTC (rev 4259)
@@ -22,7 +22,7 @@
-webkit-border-radius: 0.35em 0.35em 0 0;
color: #333;
background-color: #f7f7f7;
- line-height: 1.625em;
+ line-height: 1.5em;
}
#tabs li:first-child a {
@@ -312,7 +312,7 @@
}
h1.CuminHeading img {
- vertical-align: -60%;
+ vertical-align: -70%;
margin: 0 0.25em 0 0;
}
14 years, 3 months
rhmessaging commits: r4258 - mgmt/newdata/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-07 12:31:55 -0400 (Tue, 07 Sep 2010)
New Revision: 4258
Modified:
mgmt/newdata/cumin/python/cumin/messaging/connection.py
Log:
Fixing unreported python exception. When there is an external broker link, displaying the connections page caused an exception because the process and PID for the external broker was None.
Modified: mgmt/newdata/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-09-07 16:19:01 UTC (rev 4257)
+++ mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-09-07 16:31:55 UTC (rev 4258)
@@ -117,7 +117,7 @@
return "Process (PID)"
def render_cell_content(self, session, record):
- args = (record[self.field.index], record[self.pid_field.index])
+ args = (record[self.field.index], record[self.pid_field.index] or 0)
return "%s (%i)" % args
class ConnectionGeneralStatSet(StatSet):
14 years, 3 months
rhmessaging commits: r4257 - in mgmt/newdata: rosemary/python/rosemary and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-07 12:19:01 -0400 (Tue, 07 Sep 2010)
New Revision: 4257
Modified:
mgmt/newdata/cumin/python/cumin/objectselector.py
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
Fixing unreported exception.
Removing a broker links threw an exception when displaying the remove form. This was due to the fact that the ResemaryObject link does not have a name attribute.
The fix was to call the get_formatted_value("name") method on RoseMary object which now handles missing attributes.
Modified: mgmt/newdata/cumin/python/cumin/objectselector.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objectselector.py 2010-09-07 14:56:35 UTC (rev 4256)
+++ mgmt/newdata/cumin/python/cumin/objectselector.py 2010-09-07 16:19:01 UTC (rev 4257)
@@ -275,7 +275,7 @@
pass
def get_item_content(self, session, item):
- return item.name
+ return item.get_formatted_value("name")
class ObjectSelectorTaskForm(FoldingFieldSubmitForm):
def __init__(self, app, name, task):
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-09-07 14:56:35 UTC (rev 4256)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-09-07 16:19:01 UTC (rev 4257)
@@ -757,13 +757,20 @@
return self.get_formatted_value(attr)
def get_formatted_value(self, attr):
- value = getattr(self, attr, None)
+ value = self.get_value(attr)
formatter = None
if attr in self._class._properties_by_name:
formatter = self._class._properties_by_name[attr].formatter
#TODO: handle formatters on statistics and headers as well
return formatter and formatter(value) or value
+ def get_value(self, attr):
+ value = getattr(self, attr, None)
+ if not value:
+ # there is no attr, return the value of the 1st property
+ value = getattr(self, self._class._properties[0].name)
+ return value
+
def __repr__(self):
name = self.__class__.__name__
args = (name, self._class, self._id, self._sync_time)
14 years, 3 months