rhmessaging commits: r4095 - in mgmt/newdata: cumin/python/cumin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-09 11:39:44 -0400 (Fri, 09 Jul 2010)
New Revision: 4095
Modified:
mgmt/newdata/cumin/bin/cumin-web
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/tools.py
mgmt/newdata/wooly/python/wooly/__init__.py
Log:
Pipe debug settings down to cumin; correct objecttaskform class hierarchy
Modified: mgmt/newdata/cumin/bin/cumin-web
===================================================================
--- mgmt/newdata/cumin/bin/cumin-web 2010-07-09 02:34:34 UTC (rev 4094)
+++ mgmt/newdata/cumin/bin/cumin-web 2010-07-09 15:39:44 UTC (rev 4095)
@@ -26,6 +26,7 @@
cumin = Cumin(config.home, opts.broker, opts.database,
opts.host, opts.port)
+ cumin.debug = opts.debug
cumin.user = values.web.user
cumin.check()
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-09 02:34:34 UTC (rev 4094)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-09 15:39:44 UTC (rev 4095)
@@ -317,12 +317,10 @@
self.task = task
-class ObjectTaskForm(FoldingFieldSubmitForm):
+class ObjectTaskForm(TaskForm):
def __init__(self, app, name, task):
- super(ObjectTaskForm, self).__init__(app, name)
+ super(ObjectTaskForm, self).__init__(app, name, task)
- self.task = task
-
self.id = IntegerParameter(app, "id")
self.add_parameter(self.id)
Modified: mgmt/newdata/cumin/python/cumin/tools.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/tools.py 2010-07-09 02:34:34 UTC (rev 4094)
+++ mgmt/newdata/cumin/python/cumin/tools.py 2010-07-09 15:39:44 UTC (rev 4095)
@@ -218,7 +218,7 @@
def do_run(self, opts, args):
app = Cumin(self.config)
- app.devel_enabled = True
+ app.debug = True
try:
app.check()
Modified: mgmt/newdata/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-09 02:34:34 UTC (rev 4094)
+++ mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-09 15:39:44 UTC (rev 4095)
@@ -290,7 +290,7 @@
child.save_parameters(session, params)
def process(self, session, *args):
- if self.app.devel_enabled:
+ if self.app.debug:
profile = self.page.profile.get(session)
call = ProcessCall(profile, self, args)
@@ -311,7 +311,7 @@
child.process(session)
def render(self, session, *args):
- if self.app.devel_enabled:
+ if self.app.debug:
profile = self.page.profile.get(session)
call = RenderCall(profile, self, args)
@@ -497,7 +497,7 @@
self.finder = ResourceFinder()
- self.devel_enabled = False
+ self.debug = False
def init(self):
for page in self.pages:
@@ -600,7 +600,7 @@
else:
url = page
- if self.app.devel_enabled:
+ if self.app.debug:
profile = self.page.profile.get(self)
profile.urls.append(url)
14 years, 8 months
rhmessaging commits: r4094 - mgmt/newdata/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-08 22:34:34 -0400 (Thu, 08 Jul 2010)
New Revision: 4094
Modified:
mgmt/newdata/wooly/python/wooly/__init__.py
Log:
Revert to the old style super call
Modified: mgmt/newdata/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-09 02:23:52 UTC (rev 4093)
+++ mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-09 02:34:34 UTC (rev 4094)
@@ -478,7 +478,7 @@
class PageRedirect(Exception):
def __init__(self, url):
- super(PageRedirect, self).__init__()
+ Exception.__init__(self)
self.url = url
14 years, 8 months
rhmessaging commits: r4093 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-08 22:23:52 -0400 (Thu, 08 Jul 2010)
New Revision: 4093
Modified:
mgmt/newdata/cumin/python/cumin/widgets.py
Log:
Repair incorrect set call
Modified: mgmt/newdata/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.py 2010-07-09 02:20:33 UTC (rev 4092)
+++ mgmt/newdata/cumin/python/cumin/widgets.py 2010-07-09 02:23:52 UTC (rev 4093)
@@ -1330,7 +1330,7 @@
sess = Session(page)
page.origin.set(sess, session.marshal())
- self.redirect.set(sess.marshal())
+ self.redirect.set(session, sess.marshal())
return
14 years, 8 months
rhmessaging commits: r4092 - mgmt/newdata/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-08 22:20:33 -0400 (Thu, 08 Jul 2010)
New Revision: 4092
Modified:
mgmt/newdata/cumin/bin/cumin-database
Log:
Set up path for attempting to run config update code
Modified: mgmt/newdata/cumin/bin/cumin-database
===================================================================
--- mgmt/newdata/cumin/bin/cumin-database 2010-07-08 18:57:48 UTC (rev 4091)
+++ mgmt/newdata/cumin/bin/cumin-database 2010-07-09 02:20:33 UTC (rev 4092)
@@ -169,7 +169,14 @@
fi
python <<EOF
+import os
+import sys
+
+home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
+sys.path.append(os.path.join(home, "python"))
+
from cumin.database import modify_pghba_conf
+
modify_pghba_conf('${pghbaconf}', '${dbname}', 'cumin')
EOF
}
14 years, 8 months
rhmessaging commits: r4091 - in mgmt/newdata: mint/python/mint and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-08 14:57:48 -0400 (Thu, 08 Jul 2010)
New Revision: 4091
Modified:
mgmt/newdata/cumin/python/cumin/config.py
mgmt/newdata/cumin/python/cumin/session.py
mgmt/newdata/mint/python/mint/model.py
mgmt/newdata/rosemary/python/rosemary/sqloperation.py
mgmt/newdata/wooly/python/wooly/server.py
Log:
* Provide dedicated log files for cumin-data and cumin-web, data.log
and web.log
* Change the default logging level to INFO, and adjust a bunch of
logging points accordingly
Modified: mgmt/newdata/cumin/python/cumin/config.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/config.py 2010-07-08 13:03:50 UTC (rev 4090)
+++ mgmt/newdata/cumin/python/cumin/config.py 2010-07-08 18:57:48 UTC (rev 4091)
@@ -18,6 +18,7 @@
raise Exception("Home path '%s' is not a directory")
web = CuminConfigSection(self, "web")
+ web.log_file.default = os.path.join(self.home, "log", "web.log")
param = ConfigParameter(web, "host", str)
param.default = "localhost"
@@ -30,6 +31,7 @@
param = ConfigParameter(web, "user", str)
data = CuminConfigSection(self, "data")
+ data.log_file.default = os.path.join(self.home, "log", "data.log")
param = ConfigParameter(data, "expire-frequency", int)
param.default = 600 # 10 minutes
@@ -59,11 +61,10 @@
param = ConfigParameter(self, "model", str)
param.default = os.path.join(self.config.home, "xml")
- param = ConfigParameter(self, "log-file", str)
- param.default = os.path.join(self.config.home, "log", "cumin.log")
+ self.log_file = ConfigParameter(self, "log-file", str)
param = ConfigParameter(self, "log-level", str)
- param.default = "warn"
+ param.default = "info"
param = ConfigParameter(self, "debug", bool)
param.default = False
Modified: mgmt/newdata/cumin/python/cumin/session.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/session.py 2010-07-08 13:03:50 UTC (rev 4090)
+++ mgmt/newdata/cumin/python/cumin/session.py 2010-07-08 18:57:48 UTC (rev 4091)
@@ -104,13 +104,13 @@
self.session = session
def newPackage(self, name):
- log.info("New package %s", name)
+ log.debug("New package %s", name)
def newClass(self, kind, classKey):
- log.info("New class %s", classKey)
+ log.debug("New class %s", classKey)
def newAgent(self, qmf_agent):
- log.info("New agent %s", qmf_agent)
+ log.debug("New agent %s", qmf_agent)
self.session.lock.acquire()
try:
@@ -119,7 +119,7 @@
self.session.lock.release()
def delAgent(self, qmf_agent):
- log.info("Deleting agent %s", qmf_agent)
+ log.debug("Deleting agent %s", qmf_agent)
self.session.lock.acquire()
try:
@@ -128,7 +128,7 @@
self.session.lock.release()
def methodResponse(self, broker, seq, response):
- log.info("Method response for request %i received from %s",
+ log.debug("Method response for request %i received from %s",
seq, broker)
log.debug("Response: %s", response)
Modified: mgmt/newdata/mint/python/mint/model.py
===================================================================
--- mgmt/newdata/mint/python/mint/model.py 2010-07-08 13:03:50 UTC (rev 4090)
+++ mgmt/newdata/mint/python/mint/model.py 2010-07-08 18:57:48 UTC (rev 4091)
@@ -43,7 +43,7 @@
self.lock.release()
def print_event(self, level, message, *args):
- log.info(message, *args)
+ log.debug(message, *args)
if self.app.print_event_level >= level:
print datetime.now(), message % args
Modified: mgmt/newdata/rosemary/python/rosemary/sqloperation.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-08 13:03:50 UTC (rev 4090)
+++ mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-08 18:57:48 UTC (rev 4091)
@@ -26,13 +26,13 @@
self.log_sql(cursor, text, values)
def log_sql(self, cursor, text, values):
- log.info("Sql text: %s", text)
- log.info("Sql values:")
+ log.debug("Sql text: %s", text)
+ log.debug("Sql values:")
for item in sorted(values.items()):
- log.info(" %-34s %r", *item)
+ log.debug(" %-34s %r", *item)
- log.info("Sql row count: %i", cursor.rowcount)
+ log.debug("Sql row count: %i", cursor.rowcount)
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, self.table)
Modified: mgmt/newdata/wooly/python/wooly/server.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/server.py 2010-07-08 13:03:50 UTC (rev 4090)
+++ mgmt/newdata/wooly/python/wooly/server.py 2010-07-08 18:57:48 UTC (rev 4091)
@@ -85,6 +85,8 @@
return session
def service_request(self, env, response):
+ log.info("Servicing %s %s", env["REQUEST_METHOD"], env["REQUEST_URI"])
+
headers = list()
page = self.get_page(env)
14 years, 8 months
rhmessaging commits: r4090 - mgmt/newdata/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-08 09:03:50 -0400 (Thu, 08 Jul 2010)
New Revision: 4090
Modified:
mgmt/newdata/cumin/python/cumin/messaging/connection.py
Log:
Override the connection name that get displayed in the SelectionForm.
Modified: mgmt/newdata/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-07-08 13:03:08 UTC (rev 4089)
+++ mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-07-08 13:03:50 UTC (rev 4090)
@@ -95,6 +95,10 @@
self.qmf_call(invoc, conn, "close")
+ def get_item_content(self, session, item):
+ args = (item.remoteProcessName, item.remotePid)
+ return "%s (%i)" % args
+
class ConnectionProcessColumn(ObjectAttributeColumn):
def __init__(self, app, name, attr, pid_attr):
super(ConnectionProcessColumn, self).__init__(app, name, attr)
14 years, 8 months
rhmessaging commits: r4089 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-08 09:03:08 -0400 (Thu, 08 Jul 2010)
New Revision: 4089
Modified:
mgmt/newdata/cumin/python/cumin/objecttask.py
Log:
Added way to override item name that gets displayed in the SelectionForm
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-08 12:32:04 UTC (rev 4088)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-08 13:03:08 UTC (rev 4089)
@@ -306,6 +306,9 @@
def do_invoke(self, invoc, item, *args):
pass
+ def get_item_content(self, session, item):
+ return item.name
+
class TaskForm(FoldingFieldSubmitForm):
def __init__(self, app, name, task):
assert isinstance(task, Task)
@@ -398,7 +401,7 @@
return self.parent.selection.get(session)
def render_item_content(self, session, item):
- return item.name
+ return self.parent.task.get_item_content(session, item)
def render_item_class(self, session, item):
return "item"
14 years, 8 months
rhmessaging commits: r4088 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-08 08:32:04 -0400 (Thu, 08 Jul 2010)
New Revision: 4088
Modified:
mgmt/newdata/mint/python/mint/expire.py
mgmt/newdata/mint/python/mint/vacuum.py
Log:
Temp fix for transient schemas (not stored in database)
Modified: mgmt/newdata/mint/python/mint/expire.py
===================================================================
--- mgmt/newdata/mint/python/mint/expire.py 2010-07-08 12:30:48 UTC (rev 4087)
+++ mgmt/newdata/mint/python/mint/expire.py 2010-07-08 12:32:04 UTC (rev 4088)
@@ -41,8 +41,9 @@
count = 0
for pkg in self.model._packages:
- for cls in pkg._classes:
- count += self.delete_samples(cursor, cls, seconds)
+ if pkg.sql_schema.type != "transient":
+ for cls in pkg._classes:
+ count += self.delete_samples(cursor, cls, seconds)
log.info("Expired %i samples", count)
Modified: mgmt/newdata/mint/python/mint/vacuum.py
===================================================================
--- mgmt/newdata/mint/python/mint/vacuum.py 2010-07-08 12:30:48 UTC (rev 4087)
+++ mgmt/newdata/mint/python/mint/vacuum.py 2010-07-08 12:32:04 UTC (rev 4088)
@@ -24,8 +24,9 @@
conn.set_isolation_level(0)
for pkg in self.model._packages:
- for cls in pkg._classes:
- self.vacuum(cursor, cls)
+ if pkg.sql_schema.type != "transient":
+ for cls in pkg._classes:
+ self.vacuum(cursor, cls)
conn.set_isolation_level(level)
14 years, 8 months
rhmessaging commits: r4087 - mgmt/newdata/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-08 08:30:48 -0400 (Thu, 08 Jul 2010)
New Revision: 4087
Modified:
mgmt/newdata/cumin/resources/app.js
Log:
Fix problem with checkboxes on SelectionTables. You couldn't uncheck boxes that were checked when the page was loaded.
Modified: mgmt/newdata/cumin/resources/app.js
===================================================================
--- mgmt/newdata/cumin/resources/app.js 2010-07-07 21:34:03 UTC (rev 4086)
+++ mgmt/newdata/cumin/resources/app.js 2010-07-08 12:30:48 UTC (rev 4087)
@@ -47,14 +47,19 @@
if ((vals.length == 1) && (vals[0] == ""))
vals.empty();
var valIndex = vals.indexOf(val);
+ var negValIndex = vals.indexOf("-"+val);
if (check.checked) {
+ // the checkbox was just checked
+ if (negValIndex > -1)
+ vals.erase("-"+val);
+ else if (valIndex == -1)
+ vals.push(val);
+ } else {
if (valIndex > -1)
- vals[valIndex] = val;
- else
- vals.push(val);
+ vals.erase(val);
+ else if (negValIndex == -1)
+ vals.push("-"+val);
}
- else
- vals = vals.erase(val);
if (vals.length == 0)
delete hash[name];
else
@@ -70,15 +75,21 @@
var checks = document.forms[0].elements[key];
if (checks) {
var vals = $A(hash[key].split('|'));
+ if ((vals.length == 1) && (vals[0] == ""))
+ vals.empty();
if (typeof checks.length == "undefined") {
if (vals.contains(checks.value)) {
checks.checked = true;
}
+ if (vals.contains("-"+checks.value))
+ checks.checked = false;
} else {
for (var i=0; i < checks.length; i++) {
if (vals.contains(checks[i].value)) {
checks[i].checked = true;
}
+ if (vals.contains("-"+checks[i].value))
+ checks[i].checked = false;
}
}
}
14 years, 8 months
rhmessaging commits: r4086 - in mgmt/newdata/cumin/python/cumin: grid and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-07 17:34:03 -0400 (Wed, 07 Jul 2010)
New Revision: 4086
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/objecttask.strings
Log:
Improved task invocation display
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-07 14:42:36 UTC (rev 4085)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-07 21:34:03 UTC (rev 4086)
@@ -89,6 +89,8 @@
ad["!!descriptors"] = descriptors
+ invoc.description = "Create submission '%s'" % description
+
self.qmf_call(invoc, scheduler, "SubmitJob", ad)
class SubmissionAddForm(ObjectTaskForm):
Modified: mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py 2010-07-07 14:42:36 UTC (rev 4085)
+++ mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py 2010-07-07 21:34:03 UTC (rev 4086)
@@ -134,6 +134,9 @@
cursor.close()
conn.commit()
+
+ invoc.description = "Add broker group '%s'" % name
+
invoc.end()
class BrokerGroupAddForm(BrokerGroupForm):
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-07 14:42:36 UTC (rev 4085)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-07 21:34:03 UTC (rev 4086)
@@ -141,9 +141,9 @@
pass
class TaskInvocation(object):
- PENDING = "pending"
- FAILED = "failed"
- OK = "ok"
+ PENDING = "Pending"
+ FAILED = "Failed"
+ OK = "OK"
def __init__(self, task, login_session):
self.task = task
@@ -159,17 +159,24 @@
self.status = None
self.exception = None
+ self.description = None
self.status_code = None
self.output_args = None
self.dismissed = False
- def get_summary(self, session):
+ def get_description(self, session):
+ if self.description:
+ return self.description
+
+ return self.task.get_description(session)
+
+ def get_status(self, session):
if self.exception:
return str(self.exception)
- return "%s %r" % (self.status, self.output_args)
+ return self.status
def end(self):
log.debug("Ending %s", self.task)
@@ -184,16 +191,18 @@
log.info("Ended %s", self.task)
-class TaskInvocationSet(ItemSet):
+class TaskInvocationSet(Widget):
def __init__(self, app, name):
super(TaskInvocationSet, self).__init__(app, name)
- self.html_class = TaskInvocationSet.__name__
self.update_enabled = True
self.dismiss = IntegerParameter(app, "dismiss")
self.add_parameter(self.dismiss)
+ self.item_widget = TaskInvocationItem(app, "item")
+ self.add_child(self.item_widget)
+
def get_items(self, session):
login = session.client_session.attributes["login_session"]
return [x for x in login.task_invocations if not x.dismissed]
@@ -218,23 +227,34 @@
if items:
return super(TaskInvocationSet, self).do_render(session)
- def render_item_content(self, session, item):
- description = item.task.get_description(session)
+ def render_items(self, session):
+ writer = Writer()
+
+ for item in self.get_items(session):
+ writer.write(self.item_widget.render(session, item))
+
+ return writer.to_string()
+
+class TaskInvocationItem(Widget):
+ def render_icon_href(self, session, item):
+ return "resource?name=add-20.png"
+
+ def render_message(self, session, item):
+ description = item.get_description(session)
description = xml_escape(description)
if not description:
description = ""
- summary = item.get_summary(session)
+ status = item.get_status(session)
- # XXX oh honey
+ return "%s: %s" % (description, status)
+ def render_dismiss_href(self, session, item):
branch = session.branch()
- self.dismiss.set(branch, id(item))
- link = fmt_link(branch.marshal(), "Dismiss")
+ self.parent.dismiss.set(branch, id(item))
+ return branch.marshal()
- return ": ".join((description, summary, link))
-
class SelectionTask(Task):
def __init__(self, app, selector):
super(SelectionTask, self).__init__(app)
Modified: mgmt/newdata/cumin/python/cumin/objecttask.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-07-07 14:42:36 UTC (rev 4085)
+++ mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-07-07 21:34:03 UTC (rev 4086)
@@ -8,6 +8,19 @@
width: 80%;
}
+ul.TaskInvocationSet a.dismiss {
+ float: right;
+}
+
+[TaskInvocationSet.html]
+<ul id="{id}" class="{class}">{items}</ul>
+
+[TaskInvocationItem.html]
+<li>
+ <a class="dismiss" href="{dismiss_href}">Dismiss</a>
+ {message}
+</li>
+
[SelectionList.css]
ul.SelectionList {
list-style: none;
14 years, 8 months