rhmessaging commits: r3714 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-17 11:24:19 -0500 (Tue, 17 Nov 2009)
New Revision: 3714
Modified:
mgmt/trunk/wooly/python/wooly/forms.py
mgmt/trunk/wooly/python/wooly/forms.strings
Log:
Fix for https://bugzilla.redhat.com/show_bug.cgi?id=537958 Rather than javascript, I put the submit button first in the HTML and used css to display it after the Cancel button.
Modified: mgmt/trunk/wooly/python/wooly/forms.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.py 2009-11-16 20:39:58 UTC (rev 3713)
+++ mgmt/trunk/wooly/python/wooly/forms.py 2009-11-17 16:24:19 UTC (rev 3714)
@@ -497,14 +497,14 @@
self.return_url = Parameter(app, "return")
self.add_parameter(self.return_url)
+ self.submit_button = self.Submit(app, "submit")
+ self.submit_button.tab_index = 200
+ self.add_button(self.submit_button)
+
self.cancel_button = self.Cancel(app, "cancel")
self.cancel_button.tab_index = 201
self.add_button(self.cancel_button)
- self.submit_button = self.Submit(app, "submit")
- self.submit_button.tab_index = 200
- self.add_button(self.submit_button)
-
def submit(self, session):
self.submit_button.set(session, True)
Modified: mgmt/trunk/wooly/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.strings 2009-11-16 20:39:58 UTC (rev 3713)
+++ mgmt/trunk/wooly/python/wooly/forms.strings 2009-11-17 16:24:19 UTC (rev 3714)
@@ -53,6 +53,18 @@
return true;
}
+[FormButton.css]
+button.submit {
+ float:right;
+}
+button.submit:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: right;
+ visibility: hidden;
+}
+
[FormButton.html]
<button class="{class}" type="{type}" tabindex="{tab_index}" {disabled_attr} name="{name}" value="{value}" onclick="return {onclick}('{name}', '{value}')">{content}</button>
16 years, 5 months
rhmessaging commits: r3713 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-16 15:39:58 -0500 (Mon, 16 Nov 2009)
New Revision: 3713
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Fix for https://bugzilla.redhat.com/show_bug.cgi?id=537851. Override get_object_name and CuminProperty class for CuminExchange to output 'Default Exchange' when the name is blank.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-11-16 18:21:53 UTC (rev 3712)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-11-16 20:39:58 UTC (rev 3713)
@@ -1371,7 +1371,7 @@
super(CuminExchange, self).__init__(model, "exchange",
Exchange, ExchangeStats)
- prop = CuminProperty(self, "name")
+ prop = self.NameProperty(self, "name")
prop.title = "Name"
prop = CuminProperty(self, "type")
@@ -1439,13 +1439,21 @@
return "resource?name=exchange-36.png"
def get_object_title(self, session, object):
- name = self.get_object_name(object)
+ name = super(CuminExchange, self).get_object_name(object)
if name:
return super(CuminExchange, self).get_object_title(session, object)
else:
- return "Default Exchange"
+ return self.get_object_name(object)
+ def get_object_name(self, object):
+ return object.name and object.name or "Default Exchange"
+
+ class NameProperty(CuminProperty):
+ def value(self, session, object):
+ value = getattr(object, self.name, None)
+ return value and value or "Default Exchange"
+
class CuminBinding(RemoteClass):
def __init__(self, model):
super(CuminBinding, self).__init__(model, "binding",
16 years, 5 months
rhmessaging commits: r3712 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-16 13:21:53 -0500 (Mon, 16 Nov 2009)
New Revision: 3712
Modified:
mgmt/trunk/cumin/python/cumin/main.py
mgmt/trunk/cumin/python/cumin/main.strings
Log:
Fix the config-notice conditional
Modified: mgmt/trunk/cumin/python/cumin/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.py 2009-11-16 16:11:55 UTC (rev 3711)
+++ mgmt/trunk/cumin/python/cumin/main.py 2009-11-16 18:21:53 UTC (rev 3712)
@@ -135,7 +135,7 @@
count = len(self.app.model.mint.model.mintBrokersByUrl)
- if count == 0 or True:
+ if count == 0:
self.mode.set(session, self.notice)
def render_title(self, session):
Modified: mgmt/trunk/cumin/python/cumin/main.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.strings 2009-11-16 16:11:55 UTC (rev 3711)
+++ mgmt/trunk/cumin/python/cumin/main.strings 2009-11-16 18:21:53 UTC (rev 3712)
@@ -19,8 +19,6 @@
[OverviewView.html]
<div class="oblock OverviewView">
- {notice}
-
<table>
<tbody>
<tr>
16 years, 5 months
rhmessaging commits: r3711 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-16 11:11:55 -0500 (Mon, 16 Nov 2009)
New Revision: 3711
Modified:
mgmt/trunk/cumin/python/cumin/main.py
mgmt/trunk/cumin/python/cumin/main.strings
Log:
Bring the qmf-server configuration warning up-to-date
Modified: mgmt/trunk/cumin/python/cumin/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.py 2009-11-12 18:38:56 UTC (rev 3710)
+++ mgmt/trunk/cumin/python/cumin/main.py 2009-11-16 16:11:55 UTC (rev 3711)
@@ -127,6 +127,17 @@
self.view = OverviewView(app, "view")
self.add_mode(self.view)
+ self.notice = ConfigurationNotice(app, "notice")
+ self.add_mode(self.notice)
+
+ def do_process(self, session):
+ super(OverviewFrame, self).do_process(session)
+
+ count = len(self.app.model.mint.model.mintBrokersByUrl)
+
+ if count == 0 or True:
+ self.mode.set(session, self.notice)
+
def render_title(self, session):
return "Overview"
@@ -134,9 +145,6 @@
def __init__(self, app, name):
super(OverviewView, self).__init__(app, name)
- notice = self.ManagementServerNotice(app, "notice")
- self.add_child(notice)
-
queues = messaging.queue.TopQueueSet(app, "queues")
self.add_child(queues)
@@ -153,10 +161,5 @@
def render_icon_href(self, session):
return "resource?name=action-36.png"
- class ManagementServerNotice(Widget):
- def do_render(self, session):
- count = len(self.app.model.mint.model.mintBrokersByUrl)
-
- if count == 0:
- return super(OverviewView.ManagementServerNotice,
- self).do_render(session)
+class ConfigurationNotice(Widget):
+ pass
Modified: mgmt/trunk/cumin/python/cumin/main.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.strings 2009-11-12 18:38:56 UTC (rev 3710)
+++ mgmt/trunk/cumin/python/cumin/main.strings 2009-11-16 16:11:55 UTC (rev 3711)
@@ -53,23 +53,36 @@
</table>
</div>
-[ManagementServerNotice.css]
-div.ManagementServerNotice {
- margin: 0 0 1em 0;
+[ConfigurationNotice.css]
+div.ConfigurationNotice {
+ margin: 2em;
border: 1px dotted #cec;
- padding: 1em;
+ padding: 0 1em;
background-color: #dfd;
}
-div.ManagementServerNotice img {
- vertical-align: top;
- float: left;
- margin: 0 0.5em 0.5em 0;
+div.ConfigurationNotice h1 > img {
+ vertical-align: -60%;
+ margin: 0 0.2em 0 0 ;
}
-[ManagementServerNotice.html]
-<div class="ManagementServerNotice">
- <img src="resource?name=notice-36.png"/> This console is not
- registered with any management servers. Go to the 'Management Servers'
- tab above to add a new server.
+[ConfigurationNotice.html]
+<div class="ConfigurationNotice">
+ <h1><img src="resource?name=warning-36.png"/> QMF server not found</h1>
+
+ <p>This console is not connected to any QMF servers and as a result
+ has no management data to display.</p>
+
+ <p>To connect, set the <code>qmf</code> configuration parameter in
+ the config file located at <code>/etc/cumin/cumin.conf</code>.</p>
+
+ <blockquote><pre>[main]
+data: postgresql://cumin@localhost/cumin
+<strong>qmf: server.example.com</strong>
+</pre></blockquote>
+
+ <p>Without a user-specified setting, cumin looks for a QMF server
+ at <code>localhost:5672</code>. If you wish to use this
+ configuration, make sure there is a broker with QMF enabled running
+ at this address.</p>
</div>
16 years, 5 months
rhmessaging commits: r3710 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-12 13:38:56 -0500 (Thu, 12 Nov 2009)
New Revision: 3710
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
Handle case where conn.rollback itself fails
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2009-11-12 18:18:55 UTC (rev 3709)
+++ mgmt/trunk/mint/python/mint/update.py 2009-11-12 18:38:56 UTC (rev 3710)
@@ -100,7 +100,10 @@
broker.objectDatabaseIds.commit()
def rollback(self):
- self.conn.rollback()
+ try:
+ self.conn.rollback()
+ except:
+ log.exception("Rollback failed")
for broker in self.app.model.mintBrokersByQmfBroker.values():
broker.objectDatabaseIds.rollback()
16 years, 5 months
rhmessaging commits: r3709 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-12 13:18:55 -0500 (Thu, 12 Nov 2009)
New Revision: 3709
Modified:
mgmt/trunk/wooly/python/wooly/server.py
Log:
Make debug output handle empty query state
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-11-12 18:17:55 UTC (rev 3708)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-11-12 18:18:55 UTC (rev 3709)
@@ -144,11 +144,12 @@
def print_url_vars(self, query, writer):
writer.write("URL variables:\n\n")
- vars = query.split(";")
+ if query:
+ vars = query.split(";")
- for var in sorted(vars):
- key, value = var.split("=")
- writer.write(" %-30s %s\n" % (key, value))
+ for var in sorted(vars):
+ key, value = var.split("=")
+ writer.write(" %-30s %s\n" % (key, value))
writer.write("\n")
16 years, 5 months
rhmessaging commits: r3708 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-12 13:17:55 -0500 (Thu, 12 Nov 2009)
New Revision: 3708
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Produce a more informative error
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-11 22:38:43 UTC (rev 3707)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-12 18:17:55 UTC (rev 3708)
@@ -1339,8 +1339,10 @@
return True
elif self.app.config.user:
user = Subject.getByName(self.app.config.user)
- assert user
+ if user is None:
+ raise Exception("User '%s' not found" % self.app.config.user)
+
login = cumin.account.model.LoginSession(self.app, user)
session.client_session.attributes["login_session"] = login
16 years, 5 months
rhmessaging commits: r3707 - mgmt/trunk/mint/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-11 17:38:43 -0500 (Wed, 11 Nov 2009)
New Revision: 3707
Modified:
mgmt/trunk/mint/bin/mint-database
Log:
Revamp mint-database; add a command to perform postgres configuration
Modified: mgmt/trunk/mint/bin/mint-database
===================================================================
--- mgmt/trunk/mint/bin/mint-database 2009-11-09 21:03:12 UTC (rev 3706)
+++ mgmt/trunk/mint/bin/mint-database 2009-11-11 22:38:43 UTC (rev 3707)
@@ -5,58 +5,189 @@
exit 2
fi
-function check-basics {
+pgdata="/var/lib/pgsql/data"
+pglog="${pgdata}/pg_log"
+pghbaconf="${pgdata}/pg_hba.conf"
+dbname="cumin"
+
+function check-environment {
+ which rpm > /dev/null
+ run "rpm -q postgresql-server"
+}
+
+function check-postgresql {
# Is it installed?
# Is it initialized?
# Is it running?
- which rpm > /dev/null
- rpm -q postgresql-server
-
test -d /var/lib/pgsql/data || {
- echo "The database is not initialized; run '/sbin/service postgresql start'"
+ echo "The database is not initialized. Run 'mint-database configure'."
exit 1
}
- /sbin/service postgresql status || {
- echo "The database is not running; run '/sbin/service postgresql start'"
+ run "/sbin/service postgresql status" || {
+ echo "The database is not running. Run '/sbin/service postgresql start'."
exit 1
}
}
+function confirmed {
+ while [[ "$confirm" != "yes" ]]; do
+ echo -n "Type 'yes' to proceed or [Ctrl-c] to exit: "
+ read confirm
+ done
+
+ return 0
+}
+
+function format-output {
+ while read line; do
+ echo " | $line"
+ done
+}
+
+function run {
+ echo " | \$ $1"
+
+ if [[ "$2" ]]; then
+ su - postgres -c "$1" | format-output 2>&1
+ else
+ $1 | format-output 2>&1
+ fi
+
+ return ${PIPESTATUS[0]}
+}
+
+function initdb {
+ run "initdb --pgdata='$pgdata' --auth='ident sameuser'" postgres
+ run "mkdir '$pglog'" postgres
+ run "chmod 700 '$pglog'" postgres
+
+ /sbin/restorecon -R "$pgdata"
+}
+
+function modify-postgresql-config {
+ python <<EOF
+import re
+
+comment_or_empty_line_pattern = re.compile('^\w*#|^\w*$')
+record_pattern = re.compile('^\w*(local|host|hostssl|hostnossl)')
+
+database_name = "cumin"
+path = "/var/lib/pgsql/data/pg_hba.conf"
+file = open(path, "r")
+
+lines = list()
+first_record_index = None
+
+for i, line in enumerate(file):
+ lines.append(line)
+
+ if record_pattern.match(line):
+ if first_record_index is None:
+ first_record_index = i
+
+ tokens = line.split()
+
+ if tokens[1] == database_name:
+ raise Exception("This file already contains a " + \
+ "%s record" % database_name)
+ elif comment_or_empty_line_pattern.match(line):
+ pass
+ else:
+ raise Exception("This doesn't look like a pg_hba.conf file")
+
+file.close()
+
+if first_record_index is None:
+ first_record_index = len(lines)
+
+line = "host %s %s ::1/128 trust\n" % (database_name, database_name)
+lines.insert(first_record_index, line)
+line = "host %s %s 127.0.0.1/32 trust\n" % (database_name, database_name)
+lines.insert(first_record_index, line)
+
+file = open(path, "w")
+
+for line in lines:
+ file.write(line)
+
+file.close()
+EOF
+
+ return $?
+}
+
case "$1" in
- check)
- check-basics
+ status)
+ check-environment
+ check-postgresql
# Is it configured to be accessible?
# Is it accessible?
# Does it have a schema loaded?
- su - postgres -c "psql -c '\q'" || {
+ run "psql -c '\q'" postgres || {
echo "The database is not accessible"
exit 1
}
echo "The database is ready"
;;
+ configure)
+ check-environment
+
+ if test -f $pghbaconf && run "grep ${dbname} ${pghbaconf}"; then
+ echo "The database appears to have been configured already."
+ exit 1
+ fi
+
+ if run "/sbin/service postgresql status"; then
+ echo "The database is running. To proceed with configuration, I need to stop it."
+
+ if confirmed; then
+ run "/sbin/service postgresql stop"
+ fi
+ fi
+
+ test -d /var/lib/pgsql/data || {
+ echo "The database is not initialized. To proceed, I need to initialize it."
+
+ if confirmed; then
+ initdb
+ fi
+ }
+
+ modify-postgresql-config
+
+ echo "The database is configured. You can now run 'mint-database create'."
+
+ # chkconfig stuff ?
+ ;;
create)
- check-basics
- su - postgres -c "createuser --superuser cumin"
- su - postgres -c "createdb --owner=cumin cumin"
- mint-admin load-schema
- echo "The database is created"
+ check-environment
+ check-postgresql
+
+ run "createuser --superuser ${dbname}" postgres
+ run "createdb --owner=${dbname} ${dbname}" postgres
+
+ echo "The database is created. You can now run 'mint-admin load-schema'."
;;
destroy)
- check-basics
- su - postgres -c "dropdb cumin"
- su - postgres -c "dropuser cumin"
+ check-environment
+ check-postgresql
+
+ run "dropdb ${dbname}" postgres
+ run "dropuser ${dbname}" postgres
+
echo "The database is destroyed"
;;
*)
echo "Configure and check the mint database"
echo "Usage: mint-database COMMAND"
echo "Commands:"
- echo " check Check the database"
+ echo " status Check the database"
+ echo " configure Modify the database configuration"
echo " create Create the mint user and database"
echo " destroy Discard the mint user, database, and all data"
exit 1
16 years, 5 months
rhmessaging commits: r3706 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-09 16:03:12 -0500 (Mon, 09 Nov 2009)
New Revision: 3706
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/grid/job.strings
mgmt/trunk/cumin/python/cumin/grid/submission.py
mgmt/trunk/cumin/python/cumin/grid/submission.strings
mgmt/trunk/cumin/python/cumin/main.py
mgmt/trunk/cumin/python/cumin/main.strings
Log:
Changed from Top Jobs to Top Submissions.
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -127,43 +127,6 @@
def get(self, session):
return (self.job.get(session), self.submission.get(session))
-class TopJobSet(TopTable):
- def __init__(self, app, name):
- super(TopJobSet, self).__init__(app, name)
-
- col = self.NameColumn(app, "name")
- col.width = "60%"
- self.add_column(col)
-
- self.set_default_column(col)
-
- col = self.DurationColumn(app, "name")
- col.width = "35%"
- col.align = "right"
- self.add_column(col)
-
- class NameColumn(TopTableColumn):
- def render_title(self, session, data):
- return "Name"
-
- def render_content(self, session, data):
- pool = Identifiable(data["pool"])
- job = Identifiable(data["id"])
-
- branch = session.branch()
- self.page.main.grid.pool.object.set(session, pool)
- self.page.main.grid.pool.job.object.set(session, job)
- self.page.main.grid.pool.job.show(session)
- return fmt_link(branch.marshal(), data["name"], link_title=data["name"])
-
- class DurationColumn(TopTableColumn):
- def render_title(self, session, data):
- return "Duration"
-
- def render_content(self, session, data):
- since = data["q_date"]
- return fmt_duration(time() - secs(since))
-
class JobTab(JobSet):
def __init__(self, app, name, pool):
super(JobTab, self).__init__(app, name, pool)
Modified: mgmt/trunk/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-11-09 21:03:12 UTC (rev 3706)
@@ -40,22 +40,6 @@
inner join submitter as b on b.id = j.submitter_id
{sql_where}
-[TopJobSet.sql]
-select
- j.id,
- j.custom_id as name,
- j.q_date,
- s.pool
-from job as j
-join scheduler s on s.id = j.scheduler_id
-where j.job_status = 2
- and j.qmf_update_time > now() - interval '60 seconds'
-order by j.q_date asc
-limit 5
-
-[TopJobSet.count_sql]
---
-
[JobTab.css]
input.search_input {
color: #555;
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -282,3 +282,41 @@
class AttributesField(MultilineStringField):
def render_title(self, session):
return "Extra attributes"
+
+class TopSubmissionSet(TopTable):
+ def __init__(self, app, name):
+ super(TopSubmissionSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ col.width = "60%"
+ self.add_column(col)
+
+ self.set_default_column(col)
+
+ col = self.DurationColumn(app, "name")
+ col.width = "35%"
+ col.align = "right"
+ self.add_column(col)
+
+ class NameColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ pool = Identifiable(data["pool"])
+ submission = Identifiable(data["id"])
+
+ branch = session.branch()
+ self.page.main.grid.pool.object.set(session, pool)
+ self.page.main.grid.pool.submission.object.set(session, submission)
+ self.page.main.grid.pool.submission.show(session)
+ return fmt_link(branch.marshal(), data["name"], link_title=data["name"])
+
+ class DurationColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Duration"
+
+ def render_content(self, session, data):
+ since = data["qmf_create_time"]
+ return fmt_duration(time() - secs(since))
+
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.strings 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.strings 2009-11-09 21:03:12 UTC (rev 3706)
@@ -24,3 +24,21 @@
inner join submitter as m on s.submitter_id = m.id
inner join submission_stats as c on s.stats_curr_id = c.id
{sql_where}
+
+[TopSubmissionSet.sql]
+select
+ j.id,
+ j.name,
+ j.qmf_create_time,
+ s.pool
+from submission as j
+join scheduler s on s.id = j.scheduler_id
+left outer join submission_stats as ss on ss.id = j.stats_curr_id
+where ss.running > 0
+ and ss.qmf_update_time > now() - interval '60 seconds'
+order by j.qmf_create_time asc
+limit 5
+
+[TopSubmissionSet.count_sql]
+--
+
Modified: mgmt/trunk/cumin/python/cumin/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/main.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -140,8 +140,8 @@
queues = messaging.queue.TopQueueSet(app, "queues")
self.add_child(queues)
- jobs = grid.job.TopJobSet(app, "jobs")
- self.add_child(jobs)
+ submissions = grid.submission.TopSubmissionSet(app, "submissions")
+ self.add_child(submissions)
systems = inventory.system.TopSystemSet(app, "systems")
self.add_child(systems)
Modified: mgmt/trunk/cumin/python/cumin/main.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.strings 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/main.strings 2009-11-09 21:03:12 UTC (rev 3706)
@@ -13,6 +13,10 @@
margin: 0 0.2em 0 0;
}
+div.OverviewView {
+ clear: both;
+}
+
[OverviewView.html]
<div class="oblock OverviewView">
{notice}
@@ -29,8 +33,8 @@
</td>
<td>
<div class="fullpageable">
- <h2><img src="resource?name=job-20.png"/> Longest Running Grid Jobs</h2>
- <div class="iblock">{jobs}</div>
+ <h2><img src="resource?name=job-20.png"/> Longest Running Grid Submissions</h2>
+ <div class="iblock">{submissions}</div>
</div>
</td>
</tr>
16 years, 5 months
rhmessaging commits: r3705 - in mgmt/trunk: cumin/python/cumin/grid and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-09 15:52:45 -0500 (Mon, 09 Nov 2009)
New Revision: 3705
Modified:
mgmt/trunk/cumin/python/cumin/grid/limit.py
mgmt/trunk/cumin/python/cumin/widgets.strings
mgmt/trunk/wooly/python/wooly/profile.py
mgmt/trunk/wooly/python/wooly/server.py
Log:
* Improve the app error output
* Fix the presentation of CuminItemTable, and use it for LimitSet
Modified: mgmt/trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-11-09 19:51:58 UTC (rev 3704)
+++ mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-11-09 20:52:45 UTC (rev 3705)
@@ -16,14 +16,34 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.limit")
-class LimitSet(ItemTable):
+class LimitDataSet(object):
+ def __init__(self, app, negotiator):
+ self.app = app
+ self.negotiator = negotiator
+
+ def get_items(self, session):
+ negotiator = self.negotiator.get(session)
+
+ limits = self.app.model.get_negotiator_limits(negotiator)
+
+ if limits is None:
+ return ()
+
+ keys = limits.keys()
+ keys.sort()
+
+ return [{"name": x,
+ "curr": limits[x]["CURRENT"],
+ "max": limits[x]["MAX"]}
+ for x in keys]
+
+class LimitSet(CuminItemTable):
def __init__(self, app, name, negotiator):
super(LimitSet, self).__init__(app, name)
- self.negotiator = negotiator
+ self.data = LimitDataSet(app, negotiator)
self.defer_enabled = True
- self.update_enabled = True
col = self.NameColumn(app, "name")
self.add_column(col)
@@ -41,21 +61,8 @@
self.add_child(self.limit_count)
def do_get_items(self, session):
- negotiator = self.negotiator.get(session)
+ return self.data.get_items(session)
- limits = self.app.model.get_negotiator_limits(negotiator)
-
- if limits is None:
- return ()
-
- keys = limits.keys()
- keys.sort()
-
- return [{"name": x,
- "curr": limits[x]["CURRENT"],
- "max": limits[x]["MAX"]}
- for x in keys]
-
def render_title(self, session):
return self.limit_count.render(session)
@@ -74,9 +81,9 @@
return "Name"
def render_content(self, session, data):
- limit = Identifiable(data["name"])
+ limit = data["name"]
href = self.frame.limit.get_href(session, limit)
- return fmt_link(href, data["name"])
+ return fmt_link(href, limit)
class CurrentColumn(ItemTableColumn):
def render_title(self, session, data):
@@ -94,7 +101,7 @@
def __init__(self, app, name, negotiator):
super(LimitFrame, self).__init__(app, name)
- self.object = Parameter(app, "limit")
+ self.object = Parameter(app, "name")
self.add_parameter(self.object)
self.view = LimitView(app, "view", negotiator, self.object)
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-11-09 19:51:58 UTC (rev 3704)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-11-09 20:52:45 UTC (rev 3705)
@@ -637,6 +637,26 @@
</form>
</div>
+[CuminItemTable.html]
+<div id="{id}" class="CuminTable">
+ <table class="mobjects">
+ {columns}
+ <thead>
+ <tr>
+ <th class="setnav" colspan="{column_count}">
+ <div class="rfloat">{page}</div>
+
+ {count}
+ </th>
+ </tr>
+
+ <tr>{headers}</tr>
+ </thead>
+
+ <tbody>{items}</tbody>
+ </table>
+</div>
+
[TableHeader.css]
th.selected a {
color: black;
Modified: mgmt/trunk/wooly/python/wooly/profile.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/profile.py 2009-11-09 19:51:58 UTC (rev 3704)
+++ mgmt/trunk/wooly/python/wooly/profile.py 2009-11-09 20:52:45 UTC (rev 3705)
@@ -1,3 +1,5 @@
+import sys
+
from time import time
from collections import defaultdict
@@ -60,9 +62,9 @@
for widget in rendered.difference(processed):
print "Warning: %s was rendered but not processed" % widget
- def print_stack_trace(self):
+ def print_stack_trace(self, writer=sys.stdout):
for call in self.current_calls:
- print "in %s" % call
+ writer.write(" in %s\n" % call)
def print_process_calls(self):
if self.process_calls:
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-11-09 19:51:58 UTC (rev 3704)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-11-09 20:52:45 UTC (rev 3705)
@@ -108,8 +108,31 @@
content = page.render(session)
except:
- return self.send_error(response, headers)
+ headers.append(("Content-Type", "text/plain"))
+ response("500 Internal Error", headers)
+
+ writer = Writer()
+ writer.write("APPLICATION ERROR\n\n")
+
+ print_exc(None, writer)
+
+ writer.write("\n")
+
+ profile = page.profile.get(session)
+
+ if profile:
+ writer.write("Widget trace:\n\n")
+
+ profile.print_stack_trace(writer)
+ writer.write("\n")
+
+ self.print_url_vars(env["QUERY_STRING"], writer)
+ self.print_session(session, writer)
+ self.print_environment(env, writer)
+
+ return writer.to_string()
+
headers.append(("Content-Length", str(len(content))))
self.adapt_session_to_response(page, session, headers)
@@ -118,6 +141,37 @@
return (content,)
+ def print_url_vars(self, query, writer):
+ writer.write("URL variables:\n\n")
+
+ vars = query.split(";")
+
+ for var in sorted(vars):
+ key, value = var.split("=")
+ writer.write(" %-30s %s\n" % (key, value))
+
+ writer.write("\n")
+
+ def print_session(self, session, writer):
+ writer.write("Session:\n\n")
+
+ for path in sorted(session.values_by_path):
+ value = session.values_by_path[path]
+
+ writer.write(" %-30s %s\n" % (path, value))
+
+ writer.write("\n")
+
+ def print_environment(self, env, writer):
+ writer.write("Environment:\n\n")
+
+ for key in sorted(env):
+ value = env[key]
+
+ writer.write(" %-30s %s\n" % (key, value))
+
+ writer.write("\n")
+
def adapt_request_to_session(self, env, session):
session.unmarshal_url_vars(env["QUERY_STRING"])
@@ -196,18 +250,6 @@
return ()
- def send_error(self, response, headers):
- headers.append(("Content-Type", "text/plain"))
-
- response("500 Internal Error", headers)
-
- writer = Writer()
- writer.write("APPLICATION ERROR\n\n")
-
- print_exc(None, writer)
-
- return writer.to_string()
-
class ClientSessionExpireThread(Thread):
def __init__(self, server):
super(ClientSessionExpireThread, self).__init__()
16 years, 5 months