Author: justi9
Date: 2009-09-03 11:33:19 -0400 (Thu, 03 Sep 2009)
New Revision: 3614
Removed:
mgmt/trunk/cumin/python/cumin/managementserver.py
mgmt/trunk/cumin/python/cumin/managementserver.strings
Modified:
mgmt/trunk/cumin/python/cumin/inventory/system.py
mgmt/trunk/cumin/python/cumin/messaging/broker.py
mgmt/trunk/cumin/python/cumin/messaging/connection.py
mgmt/trunk/cumin/python/cumin/messaging/queue.py
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/parameters.py
mgmt/trunk/mint/python/mint/model.py
mgmt/trunk/mint/python/mint/poll.py
mgmt/trunk/mint/python/mint/sql.py
mgmt/trunk/mint/python/mint/update.py
mgmt/trunk/wooly/python/wooly/pages.py
Log:
* BrokerRegistration is no longer used; remove it and its associated
code from the tree
* Fix a few render_title methods with residual get_args
Modified: mgmt/trunk/cumin/python/cumin/inventory/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/inventory/system.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/inventory/system.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -227,18 +227,18 @@
# using a loop instead of an sql select with an outer join
brokers = Broker.select()
+
for broker in brokers:
if broker.system.nodeName == system.nodeName:
- if broker.registrationID:
- daemons.append(BrokerRegistration.get(broker.registrationID))
+ daemons.append(broker)
return daemons
def render_item_content(self, session, item):
- if isinstance(item, BrokerRegistration):
- reg = Identifiable(item.id)
- href = self.page.main.messaging.broker.get_href(session, reg)
- return fmt_link(href, item.url)
+ if isinstance(item, Broker):
+ broker = Identifiable(item.id)
+ href = self.page.main.messaging.broker.get_href(session, broker)
+ return fmt_link(href, item.port) # XXX item.port is too lame
else:
pool = Pool(item.Pool)
self.page.main.grid.pool.object.set(session, pool)
@@ -265,7 +265,7 @@
return "Scheduler"
elif isinstance(item, Negotiator):
return "Negotiator"
- elif isinstance(item, BrokerRegistration):
+ elif isinstance(item, Broker):
return "Broker"
else:
return "Daemon"
Deleted: mgmt/trunk/cumin/python/cumin/managementserver.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/managementserver.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/managementserver.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -1,230 +0,0 @@
-from mint import *
-from wooly import *
-from wooly.widgets import *
-
-from widgets import *
-from parameters import *
-from formats import *
-from util import *
-
-strings = StringCatalog(__file__)
-
-class ManagementServerSet(CuminSelectionTable):
- def __init__(self, app, name):
- item = Parameter(app, "item")
- super(ManagementServerSet, self).__init__(app, name, item)
-
- col = self.NameColumn(app, "name")
- self.add_column(col)
- self.set_default_column(col)
-
- col = self.UrlColumn(app, "url")
- self.add_column(col)
-
- col = self.StatusColumn(app, "status")
- self.add_column(col)
-
- #task = main.module.xxx
- #button = TaskButton(app, "remove", task, self.selection)
- #self.buttons.add_child(button)
-
- def render_title(self, session):
- return "Managent Servers"
-
- class NameColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Name"
-
- class UrlColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "URL"
-
- class StatusColumn(ItemTableColumn):
- def render_title(self, session, data):
- return "Status"
-
- def render_content(self, session, data):
- url = data["url"]
-
- try:
- server = self.app.model.mint.model.mintBrokersByUrl[url]
-
- if server.connected:
- html = "Connected"
- else:
- html = "Disconnected"
- except KeyError:
- html = "Unreachable"
-
- return html
-
-class ManagementServerSetAdd(CuminForm, Frame):
- def __init__(self, app, name):
- super(ManagementServerSetAdd, self).__init__(app, name)
-
- self.name_param = Parameter(app, "name_param");
- self.add_parameter(self.name_param)
-
- self.names = ListParameter(app, "name", self.name_param)
- self.add_parameter(self.names)
-
- self.name_errors = self.Errors(self, "name_errors")
- self.add_attribute(self.name_errors)
-
- self.addr_param = Parameter(app, "addr_param")
- self.add_parameter(self.addr_param)
-
- self.addrs = ListParameter(app, "address", self.addr_param)
- self.add_parameter(self.addrs)
-
- self.addr_errors = self.Errors(self, "addr_errors")
- self.add_attribute(self.addr_errors)
-
- self.fields = IntegerParameter(app, "fields")
- self.fields.default = 3
- self.add_parameter(self.fields)
-
- self.field_tmpl = Template(self, "field_html")
-
- self.more_button = self.MoreEntries(app, "more_button")
- self.add_child(self.more_button)
-
- self.more = self.More(app, "more")
- self.add_parameter(self.more)
-
- def process_cancel(self, session):
- branch = session.branch()
- self.frame.view.show(branch)
- self.page.set_redirect_url(session, branch.marshal())
-
- def process_submit(self, session):
- action = self.app.model.management_server.add
-
- addrs = self.addrs.get(session)
- names = self.names.get(session)
- fields = self.fields.get(session)
-
- if self.validate(session, addrs, names):
- for i in range(0, fields):
- try:
- addr = addrs[i]
- except:
- addr = None
-
- if addr:
- name = names[i]
- url = "amqp://%s:%i" % parse_broker_addr(addr)
-
- args = {"name": name, "url": url}
- reg = action.invoke(None, args)
-
- self.process_cancel(session)
-
- def validate(self, session, addrs, names):
- nerrs = self.name_errors.get(session)
- aerrs = self.addr_errors.get(session)
- fields = self.fields.get(session)
-
- for i in range(0, fields):
- try:
- addr, name = addrs[i], names[i]
- except:
- addr = name = None
-
- if not addr and not name:
- pass # It's just an empty row
- else:
- if not name:
- errs = nerrs.setdefault(i, list())
- errs.append("The name field is empty; it is required")
- elif BrokerRegistration.selectBy(name=name).count():
- errs = nerrs.setdefault(i, list())
- errs.append("A broker called '%s' already exists" %
name)
-
- if not addr:
- errs = aerrs.setdefault(i, list())
- errs.append("The address field is empty; it is required")
- else:
- try:
- parse_broker_addr(addr)
- except:
- errs = aerrs.setdefault(i, list())
- errs.append("The address is malformed")
- break
-
- count = BrokerRegistration.selectBy \
- (url=addr).count()
-
- if count:
- errs = aerrs.setdefault(i, list())
- errs.append("The broker at %s " % (url) +
- "is already registered")
-
- return not len(nerrs) and not len(aerrs)
-
- def render_title(self, session):
- return "Register New Brokers"
-
- class Errors(Attribute):
- def get_default(self, session):
- return dict()
-
- class More(Parameter):
- def get_default(self, session):
- return ""
-
- def process_display(self, session):
- if self.more.get(session):
- self.fields.set(session, self.fields.get(session) + 3)
-
- def render_fields(self, session):
- writer = Writer()
-
- for i in range(self.fields.get(session)):
- self.field_tmpl.render(writer, session, i)
-
- return writer.to_string()
-
- def render_field_name_name(self, session, index):
- return self.names.path
-
- def render_field_name_value(self, session, index):
- names = self.names.get(session)
- if len(names) > index:
- return names[index]
-
- def render_field_name_errors(self, session, index):
- errors = self.name_errors.get(session)
- if index in errors:
- return "<ul
class=\"errors\"><li>%s</li></ul>" % \
- "</li><li>".join(errors[index])
-
- def render_field_address_name(self, session, index):
- return self.addrs.path
-
- def render_field_address_value(self, session, index):
- addrs = self.addrs.get(session)
- if len(addrs) > index:
- return addrs[index]
-
- def render_field_address_errors(self, session, index):
- errors = self.addr_errors.get(session)
- if index in errors:
- return "<ul
class=\"errors\"><li>%s</li></ul>" % \
- "</li><li>".join(errors[index])
-
- def render_more_id(self, session):
- return self.more_button.path
-
- def render_more_name(self, session):
- return self.more.path
-
- class MoreEntries(FormButton):
- def render_content(self, session):
- return "More Entries"
-
- def render_class(self, session):
- return "more"
-
- def render_type(self, session):
- return "button"
Deleted: mgmt/trunk/cumin/python/cumin/managementserver.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/managementserver.strings 2009-09-02 14:03:11 UTC (rev
3613)
+++ mgmt/trunk/cumin/python/cumin/managementserver.strings 2009-09-03 15:33:19 UTC (rev
3614)
@@ -1,178 +0,0 @@
-[ManagementServerSet.sql]
-select br.id, br.name, br.url
-from broker_registration as br
-{sql_where}
-{sql_orderby}
-{sql_limit}
-
-[ManagementServerSet.count_sql]
-select count(*)
-from broker_registration as br
-{sql_where}
-
-[ManagementServerSetAdd.css]
-table.ManagementServerSetAdd td, table.ManagementServerSetAdd th {
- padding: 0.25em;
-}
-
-table.ManagementServerSetAdd span.example {
- font-weight: normal;
- font-size: 0.8em;
- font-style: italic;
-}
-
-[ManagementServerSetAdd.html]
-<form id="{id}" class="mform" method="post"
action="?">
- <div class="head">
- <h1>{title}</h1>
- </div>
- <div class="body">
- <fieldset>
- <table class="ManagementServerSetAdd">
- <tr>
- <th>Name</th>
- <th>
- Address
- <br/>
- <span class="example">Examples:
example.net,
example.net:5672, 172.16.82.10</span>
- </th>
- </tr>
-
- {fields}
- </table>
-
- {more_button}<input type="hidden" name="{more_name}"
value="" />
- </fieldset>
-
- {hidden_inputs}
- </div>
- <div class="foot">
- {help}
- {submit}
- {cancel}
- </div>
-</form>
-<script type="text/javascript" defer="defer">
-<![CDATA[
-(function() {
- var elem = $("{id}").elements[1];
-
- elem.focus();
- elem.select();
-
- function attach_more_id() {
- var oMore = document.getElementById("{more_id}");
- if (oMore) {
- oMore.onclick = function() {
- document.forms[0].elements["{more_name}"].value =
"t";
- document.forms[0].submit();
- }
- }
- }
-
- addEvent(window, "load", attach_more_id);
-}())
-]]>
-</script>
-
-[ManagementServerSetAdd.field_html]
-<tr>
- <td>
- <input type="text" name="{field_name_name}"
value="{field_name_value}"
- size="15" tabindex="100"/>
- {field_name_errors}
- </td>
- <td>
- <input type="text" name="{field_address_name}"
value="{field_address_value}"
- size="35" tabindex="100"/>
- {field_address_errors}
- </td>
-</tr>
-[ManagementServerSet.sql]
-select br.id, br.name, br.url
-from broker_registration as br
-{sql_where}
-{sql_orderby}
-{sql_limit}
-
-[ManagementServerSet.count_sql]
-select count(*)
-from broker_registration as br
-{sql_where}
-
-[ManagementServerSetAdd.css]
-table.ManagementServerSetAdd td, table.ManagementServerSetAdd th {
- padding: 0.25em;
-}
-
-table.ManagementServerSetAdd span.example {
- font-weight: normal;
- font-size: 0.8em;
- font-style: italic;
-}
-
-[ManagementServerSetAdd.html]
-<form id="{id}" class="mform" method="post"
action="?">
- <div class="head">
- <h1>{title}</h1>
- </div>
- <div class="body">
- <fieldset>
- <table class="ManagementServerSetAdd">
- <tr>
- <th>Name</th>
- <th>
- Address
- <br/>
- <span class="example">Examples:
example.net,
example.net:5672, 172.16.82.10</span>
- </th>
- </tr>
-
- {fields}
- </table>
-
- {more_button}<input type="hidden" name="{more_name}"
value="" />
- </fieldset>
-
- {hidden_inputs}
- </div>
- <div class="foot">
- {help}
- {submit}
- {cancel}
- </div>
-</form>
-<script type="text/javascript" defer="defer">
-<![CDATA[
-(function() {
- var elem = $("{id}").elements[1];
-
- elem.focus();
- elem.select();
-
- window.addEvent('domready', function () {
- var oMore = $("{more_id}");
- if (oMore) {
- oMore.onclick = function() {
- document.forms[0].elements["{more_name}"].value =
"t";
- document.forms[0].submit();
- }
- }
- });
-}())
-]]>
-</script>
-
-[ManagementServerSetAdd.field_html]
-<tr>
- <td>
- <input type="text" name="{field_name_name}"
value="{field_name_value}"
- size="15" tabindex="100"/>
- {field_name_errors}
- </td>
- <td>
- <input type="text" name="{field_address_name}"
value="{field_address_value}"
- size="35" tabindex="100"/>
- {field_address_errors}
- </td>
-</tr>
Modified: mgmt/trunk/cumin/python/cumin/messaging/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -320,197 +320,6 @@
return fmt_link(href, name, class_)
-class BrokerSetForm(CuminForm, Frame):
- def __init__(self, app, name):
- super(BrokerSetForm, self).__init__(app, name)
-
- self.name_param = Parameter(app, "name_param");
- self.add_parameter(self.name_param)
-
- self.names = ListParameter(app, "name", self.name_param)
- self.add_parameter(self.names)
-
- self.name_errors = self.Errors(self, "name_errors")
- self.add_attribute(self.name_errors)
-
- self.addr_param = Parameter(app, "addr_param")
- self.add_parameter(self.addr_param)
-
- self.addrs = ListParameter(app, "address", self.addr_param)
- self.add_parameter(self.addrs)
-
- self.addr_errors = self.Errors(self, "addr_errors")
- self.add_attribute(self.addr_errors)
-
- self.group_param = BrokerGroupParameter(app, "group_param")
- self.group_param.default = None
- self.add_parameter(self.group_param)
-
- self.groups = ListParameter(app, "group", self.group_param)
- self.add_parameter(self.groups)
-
- self.fields = IntegerParameter(app, "fields")
- self.fields.default = 3
- self.add_parameter(self.fields)
-
- self.field_tmpl = Template(self, "field_html")
- self.group_tmpl = Template(self, "group_html")
-
- self.more = self.MoreEntries(app, "more")
- self.add_child(self.more)
-
- class Errors(Attribute):
- def get_default(self, session):
- return dict()
-
- def process_display(self, session):
- if self.more.get(session):
- self.fields.set(session, self.fields.get(session) + 3)
-
- def render_fields(self, session):
- writer = Writer()
-
- for i in range(self.fields.get(session)):
- self.field_tmpl.render(writer, session, i)
-
- return writer.to_string()
-
- def render_field_name_name(self, session, index):
- return self.names.path
-
- def render_field_name_value(self, session, index):
- names = self.names.get(session)
- if len(names) > index:
- return escape_entity(names[index])
-
- def render_field_name_errors(self, session, index):
- errors = self.name_errors.get(session)
- if index in errors:
- return "<ul
class=\"errors\"><li>%s</li></ul>" % \
- "</li><li>".join(errors[index])
-
- def render_field_address_name(self, session, index):
- return self.addrs.path
-
- def render_field_address_value(self, session, index):
- addrs = self.addrs.get(session)
- if len(addrs) > index:
- return escape_entity(addrs[index])
-
- def render_field_address_errors(self, session, index):
- errors = self.addr_errors.get(session)
- if index in errors:
- return "<ul
class=\"errors\"><li>%s</li></ul>" % \
- "</li><li>".join(errors[index])
-
- def render_field_group_name(self, session, index):
- return self.groups.path
-
- def render_groups(self, session, index):
- writer = Writer()
-
- for group in BrokerGroup.select():
- self.group_tmpl.render(writer, session, index, group)
-
- return writer.to_string()
-
- def render_group_value(self, session, index, group):
- return group.id
-
- def render_group_name(self, session, index, group):
- return group.name
-
- def render_group_selected_attr(self, session, index, group):
- groups = self.groups.get(session)
- if len(groups) > index:
- if groups[index] and group.id == groups[index].id:
- return "selected=\"selected\""
-
- class MoreEntries(FormButton):
- def render_content(self, session):
- return "More Entries"
-
-class BrokerSetAdd(BrokerSetForm):
- def process_cancel(self, session):
- branch = session.branch()
- self.frame.view.show(branch)
- self.page.set_redirect_url(session, branch.marshal())
-
- def process_submit(self, session):
- action = self.app.model.broker_registration.add
-
- addrs = self.addrs.get(session)
- names = self.names.get(session)
- groups = self.groups.get(session)
- fields = self.fields.get(session)
-
- if self.validate(session, addrs, names, groups):
- for i in range(0, fields):
- try:
- addr = addrs[i]
- except:
- addr = None
-
- if addr:
- name = names[i]
- url = "amqp://%s:%i" % parse_broker_addr(addr)
-
- args = {"name": name, "url": url}
- reg = action.invoke(None, args)
-
- if len(groups) > i:
- group = groups[i]
-
- if group:
- reg.addBrokerGroup(group)
-
- self.process_cancel(session)
-
- def validate(self, session, addrs, names, groups):
- nerrs = self.name_errors.get(session)
- aerrs = self.addr_errors.get(session)
- fields = self.fields.get(session)
-
- for i in range(0, fields):
- try:
- addr, name = addrs[i], names[i]
- except:
- addr = name = None
-
- if not addr and not name:
- pass # It's just an empty row
- else:
- if not name:
- errs = nerrs.setdefault(i, list())
- errs.append("The name field is empty; it is required")
- elif BrokerRegistration.selectBy(name=name).count():
- errs = nerrs.setdefault(i, list())
- errs.append("A broker called '%s' already exists" %
name)
-
- if not addr:
- errs = aerrs.setdefault(i, list())
- errs.append("The address field is empty; it is required")
- else:
- #host, port = parse_broker_addr(addr)
- count = BrokerRegistration.selectBy \
- (url=addr).count()
-
- if count:
- errs = aerrs.setdefault(i, list())
- errs.append("The broker at %s " % (addr) +
- "is already registered")
-
- return not len(nerrs) and not len(aerrs)
-
- def render_title(self, session):
- return "Register New Brokers"
-
- def process_display(self, session, reg):
- self.broker_name.set(session, reg.name)
-
- for group in reg.groups:
- self.groups.get(session).append(group)
-
class BrokerSetEngroupForm(CuminTaskForm):
def __init__(self, app, name, task):
super(BrokerSetEngroupForm, self).__init__(app, name, task)
Modified: mgmt/trunk/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/connection.py 2009-09-02 14:03:11 UTC (rev
3613)
+++ mgmt/trunk/cumin/python/cumin/messaging/connection.py 2009-09-03 15:33:19 UTC (rev
3614)
@@ -189,7 +189,7 @@
return "Statistics"
class SendReceiveRateChart(StatFlashChart):
- def render_title(self, session, conn):
+ def render_title(self, session):
return "Bytes sent and received"
class SessionSetTaskForm(CuminTaskForm):
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -711,7 +711,7 @@
return "Durability"
class EnqueueDequeueRateChart(StatFlashChart):
- def render_title(self, session, queue):
+ def render_title(self, session):
return "Durable messages enqueued and eequeued"
class JournalStats(StatSet):
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -57,7 +57,6 @@
CuminBrokerAclModule(self)
CuminBrokerClusterModule(self)
- CuminManagementServer(self)
CuminBrokerGroup(self)
# Grid
@@ -1735,26 +1734,6 @@
prop = CuminProperty(self, "members")
prop.title = "Members"
-class CuminManagementServer(CuminClass):
- def __init__(self, model):
- super(CuminManagementServer, self).__init__ \
- (model, "management_server", BrokerRegistration)
-
- prop = CuminProperty(self, "url")
- prop.title = "URL"
- prop.summary = True
-
- def init(self):
- super(CuminManagementServer, self).init()
-
- self.frame = self.model.frame.messaging.broker # XXX
-
- def get_title(self, session):
- return "Management Server"
-
- def get_icon_href(self, session):
- return "resource?name=broker-36.png"
-
class CuminBrokerGroup(CuminClass):
def __init__(self, model):
super(CuminBrokerGroup, self).__init__ \
Modified: mgmt/trunk/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/parameters.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/cumin/python/cumin/parameters.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -65,13 +65,6 @@
for vhost in Vhost.selectBy(broker=broker, name="/"):
return vhost
-class BrokerRegistrationParameter(Parameter):
- def do_unmarshal(self, string):
- return BrokerRegistration.get(int(string))
-
- def do_marshal(self, broker):
- return str(broker.id)
-
class ConnectionParameter(Parameter):
def do_unmarshal(self, string):
return ClientConnection.get(int(string))
Modified: mgmt/trunk/mint/python/mint/model.py
===================================================================
--- mgmt/trunk/mint/python/mint/model.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/mint/python/mint/model.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -33,10 +33,6 @@
except TypeError:
pass
-Broker.sqlmeta.addColumn(ForeignKey("BrokerRegistration",
- cascade="null", default=None,
- name="registration"))
-
class Subject(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -98,26 +94,6 @@
name = StringCol(length=1000, default=None)
collectorId = StringCol(length=1000, default=None)
-class BrokerRegistration(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- name = StringCol(length=1000, default=None, unique=True, notNone=True)
- url = StringCol(length=1000, default=None)
- broker = ForeignKey("Broker", cascade="null", default=None)
-
- url_unique = DatabaseIndex(url, unique=True)
-
- def getBrokerId(self):
- return self.mintBroker.qmfId
-
- def getDefaultVhost(self):
- if self.broker:
- try:
- return Vhost.selectBy(broker=self.broker, name="/")[0]
- except IndexError:
- return None
-
class BrokerGroup(SQLObject):
class sqlmeta:
lazyUpdate = True
Modified: mgmt/trunk/mint/python/mint/poll.py
===================================================================
--- mgmt/trunk/mint/python/mint/poll.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/mint/python/mint/poll.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -1,7 +1,6 @@
import logging
from time import sleep
from psycopg2 import OperationalError
-from mint.model import BrokerRegistration
from util import MintDaemonThread
@@ -29,18 +28,4 @@
sleep(self.interval)
def do_run(self):
- regUrls = set()
-
- for reg in BrokerRegistration.select():
- if reg.url not in self.app.model.mintBrokersByUrl:
- try:
- self.app.model.addBroker(reg.url)
- except socket.error, e:
- log.info("Can't connect to broker at %s: %s", reg.url, e)
-
- regUrls.add(reg.url)
-
- for mbroker in self.app.model.mintBrokersByQmfBroker.values():
- if mbroker.url not in regUrls:
- self.app.model.delBroker(mbroker)
-
+ pass
Modified: mgmt/trunk/mint/python/mint/sql.py
===================================================================
--- mgmt/trunk/mint/python/mint/sql.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/mint/python/mint/sql.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -170,31 +170,6 @@
return sql
-class SqlGetBrokerRegistration(SqlOperation):
- def __init__(self):
- super(SqlGetBrokerRegistration, self).__init__("get_broker_reg")
-
- def generate(self):
- return """
- select id
- from broker_registration
- where url = %(url)s
- """
-
-class SqlAttachBroker(SqlOperation):
- def __init__(self):
- super(SqlAttachBroker, self).__init__("attach_broker")
-
- def generate(self):
- return """
- update broker_registration
- set broker_id = %(id)s
- where id = %(registrationId)s;
- update broker
- set registration_id = %(registrationId)s
- where id = %(id)s
- """
-
class SqlProfile(object):
def __init__(self):
self.ops = list()
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/mint/python/mint/update.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -286,9 +286,6 @@
assert cursor.rowcount == 1
self.broker.objectDatabaseIds.set(oid, id)
-
- if cls is Broker:
- self.processBroker(cursor, id)
else:
# Case 3
@@ -313,25 +310,6 @@
thread.propUpdateCount += 1
- def processBroker(self, cursor, id):
- if self.broker.databaseId is None:
- op = SqlGetBrokerRegistration()
- op.execute(cursor, {"url": self.broker.url})
-
- rec = cursor.fetchone()
-
- #print op.text, {"url": self.broker.url}
-
- if rec:
- rid = rec[0]
-
- op = SqlAttachBroker()
- op.execute(cursor, {"id": id, "registrationId": rid})
-
- #print op.text, {"id": id, "registrationId": rid}
-
- self.broker.databaseId = id
-
class StatisticUpdate(ModelUpdate):
def process(self, thread):
try:
Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py 2009-09-02 14:03:11 UTC (rev 3613)
+++ mgmt/trunk/wooly/python/wooly/pages.py 2009-09-03 15:33:19 UTC (rev 3614)
@@ -234,8 +234,12 @@
def get(self, session):
sess = super(UpdatePage.SessionParameter, self).get(session)
- sess.user_session = session.user_session
+
+ if hasattr(session, "user_session"):
+ sess.user_session = session.user_session
+
sess.background = True
+
return sess
class WidgetParameter(Parameter):