rhmessaging commits: r4166 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-29 13:28:53 -0400 (Thu, 29 Jul 2010)
New Revision: 4166
Modified:
mgmt/newdata/mint/python/mint/model.py
mgmt/newdata/mint/python/mint/update.py
Log:
Now that qmf-mint agent mapping is moved into the update queue, remove the agent locking
Modified: mgmt/newdata/mint/python/mint/model.py
===================================================================
--- mgmt/newdata/mint/python/mint/model.py 2010-07-29 16:44:00 UTC (rev 4165)
+++ mgmt/newdata/mint/python/mint/model.py 2010-07-29 17:28:53 UTC (rev 4166)
@@ -32,15 +32,6 @@
super(MintModel, self).init()
- def get_agent(self, qmf_agent):
- id = qmf_agent.getAgentBank()
-
- self.lock.acquire()
- try:
- return self.agents_by_id[id]
- finally:
- self.lock.release()
-
def print_event(self, level, message, *args):
log.debug(message, *args)
@@ -51,31 +42,21 @@
return "%s(%s)" % (self.__class__.__name__, self.model_dir)
class MintAgent(object):
- def __init__(self, model, qmf_agent):
+ def __init__(self, model, id):
self.model = model
- self.qmf_agent = qmf_agent
+ self.id = id
- self.id = qmf_agent.getAgentBank()
-
self.last_heartbeat = None
self.objects_by_id = dict()
- self.model.lock.acquire()
- try:
- assert self.id not in self.model.agents_by_id
- self.model.agents_by_id[self.id] = self
- finally:
- self.model.lock.release()
+ assert self.id not in self.model.agents_by_id
+ self.model.agents_by_id[self.id] = self
def delete(self):
assert self.model
- self.model.lock.acquire()
- try:
- del self.model.agents_by_id[self.id]
- finally:
- self.model.lock.release()
+ del self.model.agents_by_id[self.id]
self.model = None
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-29 16:44:00 UTC (rev 4165)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-29 17:28:53 UTC (rev 4166)
@@ -178,7 +178,8 @@
def do_process(self, cursor, stats):
try:
- self.agent = self.model.get_agent(self.qmf_object.getAgent())
+ agent_id = self.qmf_object.getAgent().getAgentBank()
+ self.agent = self.model.agents_by_id[agent_id]
except KeyError:
raise UpdateDropped()
@@ -486,15 +487,15 @@
self.qmf_agent = qmf_agent
def do_process(self, cursor, stats):
+ agent_id = self.qmf_agent.getAgentBank()
+
try:
- agent = self.model.get_agent(self.qmf_agent)
+ agent = self.model.agents_by_id[agent_id]
except KeyError:
- agent_id = self.qmf_agent.getAgentBank()
+ agent = MintAgent(self.model, agent_id)
- self.delete_agent_objects(cursor, stats, agent_id)
+ self.delete_agent_objects(cursor, stats, agent)
- agent = MintAgent(self.model, self.qmf_agent)
-
#timestamp = timestamp / 1000000000
#agent.last_heartbeat = datetime.fromtimestamp(timestamp)
@@ -504,7 +505,7 @@
# XXX Add periodic update of update_time
- def delete_agent_objects(self, cursor, stats, agent_id):
+ def delete_agent_objects(self, cursor, stats, agent):
for pkg in self.model._packages:
for cls in pkg._classes:
if cls._storage == "none":
@@ -513,20 +514,22 @@
if cls is self.model.com_redhat_grid.Collector:
continue
- count = cls.delete_selection(cursor, _qmf_agent_id=agent_id)
+ count = cls.delete_selection(cursor, _qmf_agent_id=agent.id)
stats.deleted += count
class AgentDelete(AgentUpdate):
def do_process(self, cursor, stats):
+ agent_id = self.qmf_agent.getAgentBank()
+
try:
- agent = self.model.get_agent(self.qmf_agent)
+ agent = self.model.agents_by_id[agent_id]
except KeyError:
raise UpdateDropped()
agent.delete()
- self.delete_agent_objects(cursor, stats, agent.id)
+ self.delete_agent_objects(cursor, stats, agent)
class UpdateDropped(Exception):
pass
14 years, 5 months
rhmessaging commits: r4165 - in mgmt/newdata/cumin/python/cumin: usergrid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-29 12:44:00 -0400 (Thu, 29 Jul 2010)
New Revision: 4165
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
Log:
Added DAG submission to Grid User. Will need to be tweaked once we know the correct ad values to submit.
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 21:58:57 UTC (rev 4164)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-29 16:44:00 UTC (rev 4165)
@@ -402,9 +402,6 @@
return "Extra attributes"
class SubmissionVMAdd(SubmissionAdd):
- def __init__(self, app, frame):
- super(SubmissionVMAdd, self).__init__(app, frame)
-
def get_add_form(self, app):
return SubmissionAddVMForm(app, self.name, self)
@@ -460,3 +457,49 @@
vm_ads.append("executable=%s" % disk)
return "\n".join(vm_ads)
+
+class SubmissionDagAdd(SubmissionAdd):
+ def __init__(self, app, frame):
+ super(SubmissionDagAdd, self).__init__(app, frame)
+
+ def get_add_form(self, app):
+ return SubmissionAddDagForm(app, self.name, self)
+
+ def get_title(self, session):
+ return "Create DAG submission"
+
+class SubmissionAddDagForm(SubmissionAddForm):
+ def add_fields(self, app):
+ self.dag = self.DagField(app, "dag")
+ self.dag.input.size = 50
+ self.dag.required = True
+ self.dag.help = "DAG descriptor file location"
+ self.add_field(self.dag)
+
+ self.universe = Attribute(app, "universe")
+ self.universe.default = "scheduler"
+ self.add_attribute(self.universe)
+
+ self.attributes_ = self.DagAttributes(app, "attributes")
+ self.add_attribute(self.attributes_)
+
+ self.command = Attribute(app, "command")
+ self.command.default = "dag"
+ self.add_attribute(self.command)
+
+ self.stdin = Attribute(app, "stdin")
+ self.add_attribute(self.stdin)
+
+ self.stdout = Attribute(app, "stdout")
+ self.add_attribute(self.stdout)
+
+ self.stderr = Attribute(app, "stderr")
+ self.add_attribute(self.stderr)
+
+ class DagField(StringField):
+ def render_title(self, session):
+ return "DAG"
+
+ class DagAttributes(Attribute):
+ def get(self, session):
+ return "dag=%s" % self.widget.dag.get(session)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-28 21:58:57 UTC (rev 4164)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-29 16:44:00 UTC (rev 4165)
@@ -50,6 +50,8 @@
def __init__(self, app, name, user):
super(OverviewFrame, self).__init__(app, name)
+ # XXX temp hack. these are
+ # not used but needed for SubmissionAdd ObjectTask
self.tasks = list()
self.id = Attribute(app, "id")
self.id.default = 0
@@ -69,9 +71,13 @@
self.add_child(self.stats)
task = SubmissionVMAdd(app, frame)
- self.link = TaskLink(app, "submissionvmadd", task)
- self.add_child(self.link)
+ self.vm_link = TaskLink(app, "submissionvmadd", task)
+ self.add_child(self.vm_link)
+ task = SubmissionDagAdd(app, frame)
+ self.dag_link = TaskLink(app, "submissiondagadd", task)
+ self.add_child(self.dag_link)
+
class SubmissionsFrame(CuminFrame):
def __init__(self, app, name, user):
super(SubmissionsFrame, self).__init__(app, name)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-28 21:58:57 UTC (rev 4164)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-29 16:44:00 UTC (rev 4165)
@@ -18,18 +18,22 @@
vertical-align: middle;
}
-div.usergrid.heading > a {
+div.usergrid.heading > ul {
float: right;
+ list-style-type: none;
}
[OverviewView.html]
<div class="usergrid heading">
+ <ul>
+ <li>{submissionvmadd}</li>
+ <li>{submissiondagadd}</li>
+ </ul><div style="clear:both;"></div>
<h2>
<img src="resource?name=job-20.png"/>
Jobs
</h2>
- {submissionvmadd}
</div>
<table class="twocol OverviewView">
14 years, 5 months
rhmessaging commits: r4164 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-28 17:58:57 -0400 (Wed, 28 Jul 2010)
New Revision: 4164
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Changes to accommodate different types of jobs submits
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 21:55:44 UTC (rev 4163)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 21:58:57 UTC (rev 4164)
@@ -97,8 +97,11 @@
def __init__(self, app, frame):
super(SubmissionAdd, self).__init__(app, frame)
- self.form = SubmissionAddForm(app, self.name, self)
+ self.form = self.get_add_form(app)
+ def get_add_form(self, app):
+ return SubmissionAddForm(app, self.name, self)
+
def get_title(self, session):
return "Create submission"
@@ -160,11 +163,11 @@
self.description.help = "This text will identify the submission"
self.add_field(self.description)
- self.command = self.CommandField(app, "command")
- self.command.input.columns = 50
- self.command.required = True
- self.command.help = "The path to the executable and any arguments"
- self.add_field(self.command)
+ self.directory = self.WorkingDirectoryField(app, "directory")
+ self.directory.input.size = 50
+ self.directory.required = True
+ self.directory.help = "Run the process in this directory"
+ self.add_field(self.directory)
self.requirements = self.RequirementsField(app, "requirements")
self.requirements.input.columns = 50
@@ -173,12 +176,15 @@
"this submission will run"
self.add_field(self.requirements)
- self.directory = self.WorkingDirectoryField(app, "directory")
- self.directory.input.size = 50
- self.directory.required = True
- self.directory.help = "Run the process in this directory"
- self.add_field(self.directory)
+ self.add_fields(app)
+ def add_fields(self, app):
+ self.command = self.CommandField(app, "command")
+ self.command.input.columns = 50
+ self.command.required = True
+ self.command.help = "The path to the executable and any arguments"
+ self.add_field(self.command)
+
self.universe = self.UniverseField(app, "universe")
self.add_extra_field(self.universe)
@@ -237,7 +243,7 @@
stdout=stdout,
stderr=stderr,
attrs=attrs)
-
+
self.task.exit_with_redirect(session)
def parse_attributes(self, session):
@@ -394,3 +400,63 @@
class AttributesField(MultilineStringField):
def render_title(self, session):
return "Extra attributes"
+
+class SubmissionVMAdd(SubmissionAdd):
+ def __init__(self, app, frame):
+ super(SubmissionVMAdd, self).__init__(app, frame)
+
+ def get_add_form(self, app):
+ return SubmissionAddVMForm(app, self.name, self)
+
+ def get_title(self, session):
+ return "Create VM submission"
+
+class SubmissionAddVMForm(SubmissionAddForm):
+ def add_fields(self, app):
+ self.disk = self.DiskField(app, "disk")
+ self.disk.input.size = 50
+ self.disk.required = True
+ self.disk.help = "VM disk img file location"
+ self.add_field(self.disk)
+
+ self.universe = Attribute(app, "universe")
+ self.universe.default = "vm"
+ self.add_attribute(self.universe)
+
+ self.attributes_ = self.VMAttributes(app, "attributes")
+ self.add_attribute(self.attributes_)
+
+ self.command = self.Command(app, "command")
+ self.command.default = ""
+ self.add_attribute(self.command)
+
+ self.stdin = Attribute(app, "stdin")
+ self.add_attribute(self.stdin)
+
+ self.stdout = Attribute(app, "stdout")
+ self.add_attribute(self.stdout)
+
+ self.stderr = Attribute(app, "stderr")
+ self.add_attribute(self.stderr)
+
+ class DiskField(StringField):
+ def render_title(self, session):
+ return "Disk"
+
+ class Command(Attribute):
+ def get(self, session):
+ return self.widget.disk.get(session)
+
+ class VMAttributes(Attribute):
+ def get(self, session):
+ vm_ads = list()
+ vm_ads.append("vm_type=kvm")
+ vm_ads.append("vm_networking=false")
+ vm_ads.append("vm_memory=128")
+ vm_ads.append("xen_kernal=included")
+
+ disk = self.widget.disk.get(session)
+ vm_ads.append("xan_disk=%s:hda:w" % disk)
+ vm_ads.append("executable=%s" % disk)
+
+ return "\n".join(vm_ads)
14 years, 5 months
rhmessaging commits: r4163 - mgmt/newdata/cumin/python/cumin/usergrid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-28 17:55:44 -0400 (Wed, 28 Jul 2010)
New Revision: 4163
Modified:
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
Log:
1st cut at user grid submit vm job.
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-28 21:53:38 UTC (rev 4162)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-28 21:55:44 UTC (rev 4163)
@@ -50,19 +50,28 @@
def __init__(self, app, name, user):
super(OverviewFrame, self).__init__(app, name)
- self.view = OverviewView(app, "view", user)
+ self.tasks = list()
+ self.id = Attribute(app, "id")
+ self.id.default = 0
+ self.add_attribute(self.id)
+
+ self.view = OverviewView(app, "view", user, self)
self.add_mode(self.view)
def render_title(self, session):
return "Overview"
class OverviewView(Widget):
- def __init__(self, app, name, user):
+ def __init__(self, app, name, user, frame):
super(OverviewView, self).__init__(app, name)
- self.stats = UserJobStatSet(self.app, "jobs", user)
+ self.stats = UserJobStatSet(app, "jobs", user)
self.add_child(self.stats)
+ task = SubmissionVMAdd(app, frame)
+ self.link = TaskLink(app, "submissionvmadd", task)
+ self.add_child(self.link)
+
class SubmissionsFrame(CuminFrame):
def __init__(self, app, name, user):
super(SubmissionsFrame, self).__init__(app, name)
@@ -85,7 +94,7 @@
cls = self.app.model.com_redhat_cumin.User
self.add_filter(self.user, self.cls.Owner, cls.name)
-
+
frame = "main.submissions.submission"
col = ObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame)
self.insert_column(1, col)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-28 21:53:38 UTC (rev 4162)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-07-28 21:55:44 UTC (rev 4163)
@@ -4,16 +4,38 @@
vertical-align: bottom;
}
+div.usergrid.heading {
+ border-top: 1px dotted #ccc;
+ padding: 0.5em 0 0 0;
+ width: 40em;
+}
+
+div.usergrid.heading > h2 {
+ display: inline;
+}
+
+div.usergrid.heading > h2 > img {
+ vertical-align: middle;
+}
+
+div.usergrid.heading > a {
+ float: right;
+}
+
[OverviewView.html]
+<div class="usergrid heading">
+ <h2>
+ <img src="resource?name=job-20.png"/>
+ Jobs
+ </h2>
+
+ {submissionvmadd}
+</div>
+
<table class="twocol OverviewView">
<tbody>
<tr>
<td>
- <h2>
- <img src="resource?name=job-20.png"/>
- Jobs
- </h2>
-
{jobs}
</td>
<td>
14 years, 5 months
rhmessaging commits: r4162 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-28 17:53:38 -0400 (Wed, 28 Jul 2010)
New Revision: 4162
Modified:
mgmt/newdata/cumin/python/cumin/widgets.py
mgmt/newdata/cumin/python/cumin/widgets.strings
Log:
Tweak background url for forms to allow forms on the main page
Modified: mgmt/newdata/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.py 2010-07-28 21:48:02 UTC (rev 4161)
+++ mgmt/newdata/cumin/python/cumin/widgets.py 2010-07-28 21:53:38 UTC (rev 4162)
@@ -257,6 +257,10 @@
def render_data(self, session):
return self.data
+ def render_background(self, session):
+ sep = (self.data and "?" in self.data) and ";" or "?"
+ return "%sformBackground=1" % sep
+
def render_type(self, session):
return self.type
Modified: mgmt/newdata/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.strings 2010-07-28 21:48:02 UTC (rev 4161)
+++ mgmt/newdata/cumin/python/cumin/widgets.strings 2010-07-28 21:53:38 UTC (rev 4162)
@@ -684,7 +684,7 @@
[BackgroundInclude.html]
<div id="BackgroundGlass"><!-- prevents clicks since disabled doesn't work on objects --></div>
-<object id="backgroundInclude" class="BackgroundInclude" data="{data};formBackground=1" type="{type}" />
+<object id="backgroundInclude" class="BackgroundInclude" data="{data}{background}" type="{type}" />
[FormHelp.javascript]
function help_window(href) {
14 years, 5 months
rhmessaging commits: r4161 - in mgmt/newdata/cumin/python/cumin: messaging and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-28 17:48:02 -0400 (Wed, 28 Jul 2010)
New Revision: 4161
Modified:
mgmt/newdata/cumin/python/cumin/grid/model.py
mgmt/newdata/cumin/python/cumin/messaging/queue.py
Log:
Fix queue remove
Modified: mgmt/newdata/cumin/python/cumin/grid/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/model.py 2010-07-28 21:41:21 UTC (rev 4160)
+++ mgmt/newdata/cumin/python/cumin/grid/model.py 2010-07-28 21:48:02 UTC (rev 4161)
@@ -36,7 +36,7 @@
# def do_enter(self, session, job):
# self.form.object.set(session, job)
-# def do_exit(self, session, job):
+# def do_exit(self, session):
# self.app.main_page.main.grid.pool.job.view.show(session)
# def get_title(self, session):
Modified: mgmt/newdata/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/queue.py 2010-07-28 21:41:21 UTC (rev 4160)
+++ mgmt/newdata/cumin/python/cumin/messaging/queue.py 2010-07-28 21:48:02 UTC (rev 4161)
@@ -51,7 +51,7 @@
def get_title(self, session):
return "Remove"
- def do_exit(self, session, queue):
+ def do_exit(self, session):
self.app.main_page.main.messaging.broker.view.show(session)
def do_invoke(self, invoc, queue):
14 years, 5 months
rhmessaging commits: r4160 - in mgmt/newdata: cumin/python/cumin/grid and 3 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-28 17:41:21 -0400 (Wed, 28 Jul 2010)
New Revision: 4160
Added:
mgmt/newdata/rosemary/python/rosemary/sqlfilter.py
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/messaging/broker.py
mgmt/newdata/cumin/python/cumin/model.py
mgmt/newdata/cumin/python/cumin/sqladapter.py
mgmt/newdata/mint/python/mint/update.py
mgmt/newdata/rosemary/python/rosemary/model.py
mgmt/newdata/rosemary/python/rosemary/sqloperation.py
mgmt/newdata/rosemary/python/rosemary/sqlquery.py
mgmt/newdata/rosemary/python/rosemary/util.py
Log:
* Support aggregate object deletes
* Add a no-delete policy for collectors
* The above required refactoring rosemary metadata init
* Make sql filters stand apart from SqlQuery, and make filters a
feature of the base SqlOperation
* Some renaming in rosemary
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -34,11 +34,12 @@
self.add_join(jobserver, submission.jobserverRef, jobserver._id)
- FreshnessFilter(self.query, submission)
+ filter = FreshnessFilter(submission)
+ self.query.add_filter(filter)
-class FreshnessFilter(SqlQueryFilter):
- def __init__(self, query, cls):
- super(FreshnessFilter, self).__init__(query)
+class FreshnessFilter(SqlFilter):
+ def __init__(self, cls):
+ super(FreshnessFilter, self).__init__()
table = cls.sql_table
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -252,7 +252,8 @@
enqueues_col = samples_table._columns_by_name["msgTotalEnqueues"]
when = "now() - interval '600 seconds'"
- SqlComparisonFilter(subquery, updated_col, when, ">=")
+ filter = SqlComparisonFilter(updated_col, when, ">=")
+ subquery.add_filter(filter)
columns = list()
columns.append(parent_col)
@@ -265,7 +266,7 @@
options.sort_ascending = False
options.group_column = "%s, %s, %s" % ("\"Queue\".name", "\"Queue\"._id", "\"Vhost\".\"_brokerRef_id\"")
- having = SqlComparisonFilter(None, "count(1)", "1", ">")
+ having = SqlComparisonFilter("count(1)", "1", ">")
options.group_having.append(having)
try:
@@ -296,10 +297,10 @@
self.adapter.vhost_id_field = ObjectSqlField \
(self.adapter, self.cls.vhostRef)
- SqlComparisonFilter(self.adapter.query,
- self.cls.msgDepth.sql_column,
- "null",
- "is not")
+ filter = SqlComparisonFilter(self.cls.msgDepth.sql_column,
+ "null",
+ "is not")
+ self.adapter.query.add_filter(filter)
class NameColumn(ObjectLinkColumn):
def render_cell_href(self, session, record):
@@ -331,10 +332,10 @@
def init(self):
super(TopSystemTable, self).init()
- SqlComparisonFilter(self.adapter.query,
- self.cls.loadAverage1Min.sql_column,
- "null",
- "is not")
+ filter = SqlComparisonFilter(self.cls.loadAverage1Min.sql_column,
+ "null",
+ "is not")
+ self.adapter.query.add_filter(filter)
class TopSubmissionTable(TopTable):
def __init__(self, app, name):
@@ -356,10 +357,13 @@
table = self.cls.sql_table
- SqlComparisonFilter(self.adapter.query, table.Running, "0", ">")
- SqlComparisonFilter(self.adapter.query, table._qmf_update_time,
- "now() - interval '60 seconds'", ">=")
+ filter = SqlComparisonFilter(table.Running, "0", ">")
+ self.adapter.query.add_filter(filter)
+ filter = SqlComparisonFilter(table._qmf_update_time,
+ "now() - interval '60 seconds'", ">=")
+ self.adapter.query.add_filter(filter)
+
class NameColumn(ObjectLinkColumn):
def render_cell_href(self, session, record):
# XXX fix this when submission has collector ref
Modified: mgmt/newdata/cumin/python/cumin/messaging/broker.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/broker.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/cumin/python/cumin/messaging/broker.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -39,11 +39,12 @@
this = mapping.sql_table._group_id
that = "%(group_id)s"
- SqlComparisonFilter(subquery, this, that)
+ filter = SqlComparisonFilter(this, that)
+ subquery.add_filter(filter)
text = subquery.emit(("1",))
- self.group_filter = SqlExistenceFilter(None, text)
+ self.group_filter = SqlExistenceFilter(text)
def get_sql_options(self, options):
sql_options = super(BrokerData, self).get_sql_options(options)
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -485,10 +485,12 @@
self.columns = columns
self.query.filters = list()
- SqlComparisonFilter(self.query, parent_col, self.parent_id, "=")
+ filter = SqlComparisonFilter(parent_col, self.parent_id, "=")
+ self.query.add_filter(filter)
when = "now() - interval '%i seconds'" % int(secs + secs2)
- SqlComparisonFilter(self.query, updated_col, when, ">=")
+ filter = SqlComparisonFilter(updated_col, when, ">=")
+ self.query.add_filter(filter)
when2 = ""
if secs2:
when2 = "now() - interval '%i seconds'" % int(secs2)
@@ -518,15 +520,18 @@
self.columns = columns
self.query.filters = list()
- SqlComparisonFilter(self.query, parent_col, self.parent_id, "=")
+ filter = SqlComparisonFilter(parent_col, self.parent_id, "=")
+ self.query.add_filter(filter)
if not delta:
when = "now() - interval '%i seconds'" % int(secs + secs2)
- SqlComparisonFilter(self.query, updated_col, when, ">=")
+ filter = SqlComparisonFilter(updated_col, when, ">=")
+ self.query.add_filter(filter)
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()
Modified: mgmt/newdata/cumin/python/cumin/sqladapter.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/sqladapter.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/cumin/python/cumin/sqladapter.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -92,7 +92,8 @@
assert attr
value = "%%(%s)s" % attr.name
- SqlComparisonFilter(self.query, attr.sql_column, value)
+ filter = SqlComparisonFilter(attr.sql_column, value)
+ self.query.add_filter(filter)
class ObjectSqlField(SqlField):
def __init__(self, adapter, attr):
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -282,7 +282,7 @@
statements = list()
- sql = cls.sql_insert.emit(object_columns)
+ sql = cls.sql_insert_object.emit(object_columns)
statements.append(sql)
if sample_columns:
@@ -322,7 +322,7 @@
if object_columns:
object_columns.append(cls.sql_table._qmf_update_time)
- sql = cls.sql_update.emit(object_columns)
+ sql = cls.sql_update_object.emit(object_columns)
statements.append(sql)
if sample_columns:
@@ -510,12 +510,13 @@
if cls._storage == "none":
continue
- for obj in cls.get_selection(cursor, _qmf_agent_id=agent_id):
- obj.delete(cursor)
+ if cls is self.model.com_redhat_grid.Collector:
+ continue
- self.model.print_event(3, "Deleted %s", obj)
- stats.deleted += 1
+ count = cls.delete_selection(cursor, _qmf_agent_id=agent_id)
+ stats.deleted += count
+
class AgentDelete(AgentUpdate):
def do_process(self, cursor, stats):
try:
@@ -525,7 +526,7 @@
agent.delete()
- self.delete_agent_objects(cursor, stats, agent)
+ self.delete_agent_objects(cursor, stats, agent.id)
class UpdateDropped(Exception):
pass
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -75,6 +75,9 @@
for pkg in self._packages:
pkg.init()
+ for pkg in self._packages:
+ pkg.init_references()
+
class RosemaryPackage(object):
def __init__(self, model, name):
self._model = model
@@ -116,6 +119,10 @@
for cls in self._classes:
cls.init()
+ def init_references(self):
+ for cls in self._classes:
+ cls.init_references()
+
def __repr__(self):
args = (self.__class__.__name__, self._name)
return "%s(%s)" % args
@@ -158,56 +165,10 @@
self._indexes = list()
self._indexes_by_name = dict()
- self.add_sql()
-
self._id = RosemaryAttribute(self, "_id")
- self._id.sql_column = self.sql_table.key_column
self.add_headers()
- def add_sql(self):
- # Main table
-
- name = "%s_id_seq" % self._name
- self.sql_sequence = SqlSequence(self._package.sql_schema, name)
-
- self.sql_table = SqlTable(self._package.sql_schema, self._name)
-
- id_col = SqlColumn(self.sql_table, "_id", sql_int8)
- self.sql_table.key_column = id_col
-
- name = "%s_pk" % self._name
- SqlPrimaryKeyConstraint(self.sql_table, name, (id_col,))
-
- self.sql_get_new_id = SqlGetNewId(self.sql_table, self.sql_sequence)
- self.sql_select = SqlQuery(self.sql_table)
- self.sql_select_by_id = SqlSelectItem(self.sql_table)
- self.sql_select_by_qmf_id = SqlSelectItemByQmfId(self.sql_table)
-
- self.sql_insert = SqlInsertItem(self.sql_table)
- self.sql_update = SqlUpdateItem(self.sql_table)
- self.sql_delete = SqlDeleteItem(self.sql_table)
-
- # Stats table
-
- name = "%s_samples" % self._name
- self.sql_samples_table = SqlTable(self._package.sql_schema, name)
-
- name = "_parent_id"
- parent_col = SqlColumn(self.sql_samples_table, name, sql_int8)
- parent_col.foreign_key_column = id_col
-
- table = self.sql_samples_table
- name = "%s_fk" % parent_col.name
- constraint = SqlForeignKeyConstraint(table, name, parent_col, id_col)
- constraint.on_delete = "cascade"
-
- name = "_qmf_update_time"
- SqlColumn(self.sql_samples_table, name, sql_timestamp)
-
- self.sql_samples_insert = SqlInsertItemStats(self.sql_samples_table)
- self.sql_samples_delete = SqlDeleteItemStats(self.sql_samples_table)
-
def add_headers(self):
name = "_qmf_agent_id"
self._qmf_agent_id = RosemaryHeader(self, name, sql_text)
@@ -236,14 +197,6 @@
self._qmf_session_id.optional = True
self._qmf_delete_time.optional = True
- def add_constraints(self):
- name = "%s_qmf_id_uq" % self._name
- cols = (self._qmf_agent_id.sql_column,
- self._qmf_object_id.sql_column,
- self._qmf_session_id.sql_column)
-
- SqlUniqueConstraint(self.sql_table, name, cols)
-
def load(self, elem, groups_by_name):
log.debug("Loading %s", self)
@@ -311,12 +264,13 @@
if not self._title:
self._title = generate_title(self._name)
+ self.add_sql_entities()
+
+ self._id.sql_column = self.sql_table.key_column
+
for hdr in self._headers:
hdr.init()
- for ref in self._references:
- ref.init()
-
for prop in self._properties:
prop.init()
@@ -329,23 +283,78 @@
for idx in self._indexes:
idx.init()
- self.add_constraints()
+ self.add_sql_constraints()
+ self.add_sql_operations()
+ def init_references(self):
+ for ref in self._references:
+ ref.init()
+
+ def add_sql_entities(self):
+ # Main table
+
+ name = "%s_id_seq" % self._name
+ self.sql_sequence = SqlSequence(self._package.sql_schema, name)
+
+ self.sql_table = SqlTable(self._package.sql_schema, self._name)
+
+ id_col = SqlColumn(self.sql_table, "_id", sql_int8)
+ self.sql_table.key_column = id_col
+
+ name = "%s_pk" % self._name
+ SqlPrimaryKeyConstraint(self.sql_table, name, (id_col,))
+
+ # Stats table
+
+ name = "%s_samples" % self._name
+ self.sql_samples_table = SqlTable(self._package.sql_schema, name)
+
+ name = "_parent_id"
+ parent_col = SqlColumn(self.sql_samples_table, name, sql_int8)
+ parent_col.foreign_key_column = id_col
+
+ table = self.sql_samples_table
+ name = "%s_fk" % parent_col.name
+ constraint = SqlForeignKeyConstraint(table, name, parent_col, id_col)
+ constraint.on_delete = "cascade"
+
+ name = "_qmf_update_time"
+ SqlColumn(self.sql_samples_table, name, sql_timestamp)
+
+ def add_sql_constraints(self):
+ name = "%s_qmf_id_uq" % self._name
+ cols = (self._qmf_agent_id.sql_column,
+ self._qmf_object_id.sql_column,
+ self._qmf_session_id.sql_column)
+
+ SqlUniqueConstraint(self.sql_table, name, cols)
+
+ def add_sql_operations(self):
+ self.sql_get_new_id = SqlGetNewId(self.sql_table, self.sql_sequence)
+ self.sql_select_by_id = SqlSelectObject(self.sql_table)
+ self.sql_select_by_qmf_id = SqlSelectObjectByQmfId(self.sql_table)
+
+ self.sql_insert_object = SqlInsertObject(self.sql_table)
+ self.sql_update_object = SqlUpdateObject(self.sql_table)
+ self.sql_delete_object = SqlDeleteObject(self.sql_table)
+
+ table = self.sql_samples_table
+
+ self.sql_samples_insert = SqlInsertObjectSamples(table)
+ self.sql_samples_delete = SqlDeleteObjectSamples(table)
+
def get_object(self, cursor, **criteria):
columns = self.sql_table._columns
- options = SqlQueryOptions()
+ sql = SqlSelect(self.sql_table)
for name in criteria:
# XXX need to translate ref=obj args here
column = self.sql_table._columns_by_name[name]
- value = "%%(%s)s" % name
- filter = SqlComparisonFilter(None, column, value)
+ sql.add_filter(SqlValueFilter(column))
- options.filters.append(filter)
+ sql.execute(cursor, columns, criteria)
- self.sql_select.execute(cursor, columns, criteria, options)
-
record = cursor.fetchone()
if not record:
@@ -361,19 +370,16 @@
selection = list()
columns = self.sql_table._columns
- options = SqlQueryOptions()
+ sql = SqlSelect(self.sql_table)
for name in criteria:
# XXX need to translate ref=obj args here
column = self.sql_table._columns_by_name[name]
- value = "%%(%s)s" % name
- filter = SqlComparisonFilter(None, column, value)
+ sql.add_filter(SqlValueFilter(column))
- options.filters.append(filter)
-
- self.sql_select.execute(cursor, columns, criteria, options)
-
+ sql.execute(cursor, columns, criteria)
+
for record in cursor.fetchall():
obj = RosemaryObject(self, None)
@@ -420,7 +426,6 @@
assert obj._id, obj
columns = self.sql_table._columns
-
self.sql_select_by_id.execute(cursor, columns, obj.__dict__)
values = cursor.fetchone()
@@ -462,9 +467,9 @@
columns = self.sql_table._columns
if obj._sync_time:
- self.sql_update.execute(cursor, columns, obj.__dict__)
+ self.sql_update_object.execute(cursor, columns, obj.__dict__)
else:
- self.sql_insert.execute(cursor, columns, obj.__dict__)
+ self.sql_insert_object.execute(cursor, columns, obj.__dict__)
obj._sync_time = datetime.now()
@@ -481,11 +486,19 @@
assert isinstance(obj, RosemaryObject)
assert obj._id
- self.sql_delete.execute(cursor, (), obj.__dict__)
+ self.sql_delete_object.execute(cursor, (), obj.__dict__)
- def delete_selection(self, cursor, **kwargs):
- pass # XXX
+ def delete_selection(self, cursor, **criteria):
+ sql = SqlDelete(self.sql_table)
+ for name in criteria:
+ column = self.sql_table._columns_by_name[name]
+ sql.add_filter(SqlValueFilter(column))
+
+ sql.execute(cursor, (), criteria)
+
+ return cursor.rowcount
+
def __repr__(self):
args = (self.__class__.__name__, self._package._name, self._name)
return "%s(%s,%s)" % args
@@ -592,7 +605,7 @@
name = "%s_fk" % col.name
SqlForeignKeyConstraint(col.table, name, col, col.foreign_key_column)
-
+
class RosemaryProperty(RosemaryAttribute):
def __init__(self, cls, name):
super(RosemaryProperty, self).__init__(cls, name)
Added: mgmt/newdata/rosemary/python/rosemary/sqlfilter.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/sqlfilter.py (rev 0)
+++ mgmt/newdata/rosemary/python/rosemary/sqlfilter.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -0,0 +1,34 @@
+from util import *
+
+log = logging.getLogger("rosemary.sqlfilter")
+
+class SqlFilter(object):
+ pass
+
+class SqlComparisonFilter(SqlFilter):
+ def __init__(self, this, that, operator="="):
+ super(SqlComparisonFilter, self).__init__()
+
+ assert isinstance(operator, str)
+
+ self.this = getattr(this, "identifier", this)
+ self.that = getattr(that, "identifier", that)
+ self.operator = operator
+
+ def emit(self):
+ return "%s %s %s" % (self.this, self.operator, self.that)
+
+class SqlValueFilter(SqlComparisonFilter):
+ def __init__(self, this, operator="="):
+ that = "%%(%s)s" % this.name
+ super(SqlValueFilter, self).__init__(this, that, operator)
+
+class SqlExistenceFilter(SqlFilter):
+ def __init__(self, subquery, operator="exists"):
+ super(SqlExistenceFilter, self).__init__()
+
+ self.subquery = subquery
+ self.operator = operator
+
+ def emit(self):
+ return "%s (%s)" % (self.operator, self.subquery)
Modified: mgmt/newdata/rosemary/python/rosemary/sqloperation.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -1,3 +1,4 @@
+from sqlfilter import *
from sqlmodel import *
from util import *
@@ -6,7 +7,14 @@
class SqlOperation(object):
def __init__(self, table):
self.table = table # XXX consider making this "relation" or "object"
+ self.filters = list()
+ def add_filter(self, filter):
+ self.filters.append(filter)
+
+ def get_filter_exprs(self):
+ return " and ".join([x.emit() for x in self.filters])
+
def execute(self, cursor, columns, values=None, options=None):
text = self.emit(columns, options)
@@ -25,6 +33,9 @@
if self.table._schema._model._model.sql_logging_enabled:
self.log_sql(cursor, text, values)
+ def emit(self, columns, options=None):
+ raise Exception("Not implemented")
+
def log_sql(self, cursor, text, values):
log.debug("Sql text: %s", text)
log.debug("Sql values:")
@@ -46,37 +57,43 @@
def emit(self, columns, options=None):
return "select nextval('%s')" % self.sequence.identifier
-class SqlSelectItem(SqlOperation):
+class SqlSelect(SqlOperation):
def emit(self, columns, options=None):
+ tokens = list()
+
cols = ", ".join([x.identifier for x in columns])
table = getattr(self.table, "identifier", self.table)
- return "select %s from %s where _id = %%(_id)s" % (cols, table)
+ tokens.append("select %s from %s" % (cols, table))
-class SqlSelectItemByQmfId(SqlOperation):
- def emit(self, columns, options=None):
- cols = ", ".join([x.identifier for x in columns])
- table = getattr(self.table, "identifier", self.table)
+ if self.filters:
+ tokens.append("where %s" % self.get_filter_exprs())
- exprs = list()
- exprs.append("_qmf_agent_id = %(_qmf_agent_id)s")
- exprs.append("_qmf_object_id = %(_qmf_object_id)s")
- exprs = " and ".join(exprs)
+ return " ".join(tokens)
- return "select %s from %s where %s" % (cols, table, exprs)
+class SqlSelectObject(SqlSelect):
+ def __init__(self, table):
+ super(SqlSelectObject, self).__init__(table)
-class SqlInsertItem(SqlOperation):
+ self.add_filter(SqlValueFilter(self.table._id))
+
+class SqlSelectObjectByQmfId(SqlSelect):
+ def __init__(self, table):
+ super(SqlSelectObjectByQmfId, self).__init__(table)
+
+ self.add_filter(SqlValueFilter(self.table._qmf_agent_id))
+ self.add_filter(SqlValueFilter(self.table._qmf_object_id))
+
+class SqlInsertObject(SqlOperation):
def emit(self, columns, options=None):
table = getattr(self.table, "identifier", self.table)
names = [x.name for x in columns]
cols = ", ".join(["\"%s\"" % x for x in names])
vals = ", ".join(["%%(%s)s" % x for x in names])
- args = (table, cols, vals)
+ return "insert into %s (%s) values (%s)" % (table, cols, vals)
- return "insert into %s (%s) values (%s)" % args
-
-class SqlInsertItemStats(SqlOperation):
+class SqlInsertObjectSamples(SqlOperation):
def emit(self, columns, options=None):
table = getattr(self.table, "identifier", self.table)
names = [x.name for x in columns]
@@ -92,26 +109,53 @@
return "insert into %s (%s) values (%s)" % (table, cols, vals)
-class SqlUpdateItem(SqlOperation):
+class SqlUpdate(SqlOperation):
def emit(self, columns, options=None):
+ tokens = list()
+
table = getattr(self.table, "identifier", self.table)
exprs = ["\"%s\" = %%(%s)s" % (x.name, x.name)
for x in columns
if x is not self.table.key_column]
exprs = ", ".join(exprs)
- return "update %s set %s where _id = %%(_id)s" % (table, exprs)
+ tokens.append("update %s set %s" % (table, exprs))
-class SqlDeleteItem(SqlOperation):
- def emit(self, columns, options=None):
- table = getattr(self.table, "identifier", self.table)
+ if self.filters:
+ tokens.append("where %s" % self.get_filter_exprs())
- return "delete from %s where _id = %%(_id)s" % table
+ return " ".join(tokens)
-class SqlDeleteItemStats(SqlOperation):
+class SqlUpdateObject(SqlUpdate):
+ def __init__(self, table):
+ super(SqlUpdateObject, self).__init__(table)
+
+ self.add_filter(SqlValueFilter(self.table._id))
+
+class SqlDelete(SqlOperation):
def emit(self, columns, options=None):
+ tokens = list()
+
table = getattr(self.table, "identifier", self.table)
- expr = "_qmf_update_time < now() - interval '%(seconds)s seconds'"
+ tokens.append("delete from %s" % table)
- return "delete from %s where %s" % (table, expr)
+ if self.filters:
+ tokens.append("where %s" % self.get_filter_exprs())
+
+ return " ".join(tokens)
+
+class SqlDeleteObject(SqlDelete):
+ def __init__(self, table):
+ super(SqlDeleteObject, self).__init__(table)
+
+ self.add_filter(SqlValueFilter(self.table._id))
+
+class SqlDeleteObjectSamples(SqlDelete):
+ def __init__(self, table):
+ super(SqlDeleteObjectSamples, self).__init__(table)
+
+ this = self.table._qmf_update_time
+ that = "now() - interval '%(seconds)s seconds'"
+
+ self.add_filter(SqlComparisonFilter(this, that, "<"))
Modified: mgmt/newdata/rosemary/python/rosemary/sqlquery.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/sqlquery.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/rosemary/python/rosemary/sqlquery.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -13,7 +13,6 @@
self.group_by = self.GroupBy()
self.joins = list()
- self.filters = list()
def emit(self, columns, options=None):
tokens = list()
@@ -32,16 +31,17 @@
for join in self.joins:
tokens.append(join.emit())
- filters = list()
+ exprs = list()
if self.filters:
- filters.extend([x.emit() for x in self.filters])
+ exprs.extend([x.emit() for x in self.filters])
+ # XXX get rid of this
if options and options.filters:
- filters.extend([x.emit() for x in options.filters])
+ exprs.extend([x.emit() for x in options.filters])
- if filters:
- tokens.append("where %s" % " and ".join(filters))
+ if exprs:
+ tokens.append("where %s" % " and ".join(exprs))
if options:
if options.group_column:
@@ -121,37 +121,3 @@
args = (self.table, self.this, self.that)
return "left outer join %s on %s = %s" % args
-
-class SqlQueryFilter(object):
- def __init__(self, query):
- if query:
- assert isinstance(query, SqlQuery), query
-
- self.query = query
-
- if self.query:
- assert self not in self.query.filters
- self.query.filters.append(self)
-
-class SqlComparisonFilter(SqlQueryFilter):
- def __init__(self, query, this, that, operator="="):
- super(SqlComparisonFilter, self).__init__(query)
-
- assert isinstance(operator, str)
-
- self.this = getattr(this, "identifier", this)
- self.that = getattr(that, "identifier", that)
- self.operator = operator
-
- def emit(self):
- return "%s %s %s" % (self.this, self.operator, self.that)
-
-class SqlExistenceFilter(SqlQueryFilter):
- def __init__(self, query, subquery, operator="exists"):
- super(SqlExistenceFilter, self).__init__(query)
-
- self.subquery = subquery
- self.operator = operator
-
- def emit(self):
- return "%s (%s)" % (self.operator, self.subquery)
Modified: mgmt/newdata/rosemary/python/rosemary/util.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/util.py 2010-07-28 17:12:53 UTC (rev 4159)
+++ mgmt/newdata/rosemary/python/rosemary/util.py 2010-07-28 21:41:21 UTC (rev 4160)
@@ -2,7 +2,10 @@
import os
import sys
+from pprint import pprint
+
try:
from xml.etree.ElementTree import *
except ImportError:
from elementtree.ElementTree import *
+
14 years, 5 months
rhmessaging commits: r4159 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-28 13:12:53 -0400 (Wed, 28 Jul 2010)
New Revision: 4159
Modified:
mgmt/newdata/mint/python/mint/session.py
Log:
Temporarily disable package binding
Modified: mgmt/newdata/mint/python/mint/session.py
===================================================================
--- mgmt/newdata/mint/python/mint/session.py 2010-07-28 13:19:01 UTC (rev 4158)
+++ mgmt/newdata/mint/python/mint/session.py 2010-07-28 17:12:53 UTC (rev 4159)
@@ -38,11 +38,14 @@
rcvObjects=self.app.update_enabled,
rcvEvents=False,
rcvHeartbeats=True,
- userBindings=True)
+ userBindings=False)
- for pkg in self.app.model._packages:
- self.qmf_session.bindPackage(pkg._name)
+ # XXX temporarily disabled
+ # userBindings=True)
+ #for pkg in self.app.model._packages:
+ # self.qmf_session.bindPackage(pkg._name)
+
self.add_broker(self.broker_uri)
def stop(self):
14 years, 5 months
rhmessaging commits: r4158 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-28 09:19:01 -0400 (Wed, 28 Jul 2010)
New Revision: 4158
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Repair agent reference
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-28 13:13:54 UTC (rev 4157)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-28 13:19:01 UTC (rev 4158)
@@ -519,7 +519,7 @@
class AgentDelete(AgentUpdate):
def do_process(self, cursor, stats):
try:
- agent = self.model.get_agent(qmf_agent)
+ agent = self.model.get_agent(self.qmf_agent)
except KeyError:
raise UpdateDropped()
14 years, 5 months
rhmessaging commits: r4157 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-28 09:13:54 -0400 (Wed, 28 Jul 2010)
New Revision: 4157
Modified:
mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
Log:
handle True and False when neither CJSON nor JJSON are installed
Modified: mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-07-28 13:01:29 UTC (rev 4156)
+++ mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-07-28 13:13:54 UTC (rev 4157)
@@ -22,7 +22,7 @@
JJSON = True
except ImportError:
pass
-import copy
+import copy
class Chart(dict):
# Dictionary for replacing attribute names
@@ -82,7 +82,10 @@
elif JJSON:
return json.dumps(attributes)
else:
- return str(attributes).replace("': u'", "': '")
+ return str(attributes).\
+ replace("': u'", "': '").\
+ replace(": True,", ": true,").\
+ replace(": False,", ": false,")
class Element(Chart):
14 years, 5 months