r5519 - trunk/rosemary/python/rosemary
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-23 19:49:54 +0000 (Tue, 23 Oct 2012)
New Revision: 5519
Modified:
trunk/rosemary/python/rosemary/sqlfilter.py
Log:
Adding SqlILikeFilter to do case-insensitive searching.
Modified: trunk/rosemary/python/rosemary/sqlfilter.py
===================================================================
--- trunk/rosemary/python/rosemary/sqlfilter.py 2012-10-23 14:53:24 UTC (rev 5518)
+++ trunk/rosemary/python/rosemary/sqlfilter.py 2012-10-23 19:49:54 UTC (rev 5519)
@@ -89,6 +89,13 @@
def __init__(self, this, operator="like"):
super(SqlLikeFilter, self).__init__(this, operator)
+class SqlILikeFilter(SqlValueFilter):
+ BEGINS = "B"
+ CONTAINS = "C"
+ def __init__(self, this, operator="ilike"):
+ super(SqlILikeFilter, self).__init__(this, operator)
+
+
class SqlDateValueFilter(SqlFilter):
def __init__(self, this, that, operator="="):
super(SqlDateValueFilter, self).__init__()
@@ -100,4 +107,4 @@
self.operator = operator
def emit(self):
- return "date_trunc('day', %s) %s date_trunc('day', date('%s'))" % (self.this, self.operator, self.that)
\ No newline at end of file
+ return "%s %s date('%s')" % (self.this, self.operator, self.that)
\ No newline at end of file
11 years, 8 months
r5518 - trunk/cumin/etc
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-23 14:53:24 +0000 (Tue, 23 Oct 2012)
New Revision: 5518
Modified:
trunk/cumin/etc/cumin.service
Log:
Cumin needs to run as the 'cumin' user under systemd
Modified: trunk/cumin/etc/cumin.service
===================================================================
--- trunk/cumin/etc/cumin.service 2012-10-22 19:09:00 UTC (rev 5517)
+++ trunk/cumin/etc/cumin.service 2012-10-23 14:53:24 UTC (rev 5518)
@@ -3,6 +3,7 @@
After=postgresql.target
[Service]
+User=cumin
Type=simple
ExecStart=/usr/bin/cumin --syslog
11 years, 8 months
r5517 - trunk/cumin/python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-22 19:09:00 +0000 (Mon, 22 Oct 2012)
New Revision: 5517
Modified:
trunk/cumin/python/cumin/persona.py
Log:
This file shouldn't have a shebang in it
Modified: trunk/cumin/python/cumin/persona.py
===================================================================
--- trunk/cumin/python/cumin/persona.py 2012-10-19 19:08:28 UTC (rev 5516)
+++ trunk/cumin/python/cumin/persona.py 2012-10-22 19:09:00 UTC (rev 5517)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
import logging
import os.path
import re
11 years, 8 months
r5516 - in trunk/sage/python/sage: . aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-19 19:08:28 +0000 (Fri, 19 Oct 2012)
New Revision: 5516
Modified:
trunk/sage/python/sage/aviary/aviaryoperations.py
trunk/sage/python/sage/util.py
Log:
Use socket.fqdn for building server lists and looking up hosts in
FixedServerList
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2012-10-19 16:40:42 UTC (rev 5515)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2012-10-19 19:08:28 UTC (rev 5516)
@@ -68,6 +68,7 @@
'''
scheme = ""
host = ""
+ name = socket.getfqdn(name)
if name in servers:
urls = servers[name]
if len(urls) > 0:
Modified: trunk/sage/python/sage/util.py
===================================================================
--- trunk/sage/python/sage/util.py 2012-10-19 16:40:42 UTC (rev 5515)
+++ trunk/sage/python/sage/util.py 2012-10-19 19:08:28 UTC (rev 5516)
@@ -4,6 +4,7 @@
import copy
import string
import os
+import socket
class MethodResult(object):
'''
@@ -268,6 +269,8 @@
url.port = loc
else:
url = parse_URL(loc)
+ if url.host is not None:
+ url.host = socket.getfqdn(url.host)
if url.scheme is None:
url.scheme = default_scheme
if url.path is None:
11 years, 8 months
r5515 - trunk/cumin/python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-19 16:40:42 +0000 (Fri, 19 Oct 2012)
New Revision: 5515
Modified:
trunk/cumin/python/cumin/model.py
Log:
Only request new groups instead of all groups when missing groups are needed for quota displays
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2012-10-18 18:02:31 UTC (rev 5514)
+++ trunk/cumin/python/cumin/model.py 2012-10-19 16:40:42 UTC (rev 5515)
@@ -151,11 +151,12 @@
try:
dynamic_store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
dynamic_store.extend_updates()
- added = 0
+ added = []
for group in needed_groups:
- added += dynamic_store.add_group_config(group, config)
- if added > 0:
- dynamic_store.update_new(None)
+ if dynamic_store.add_group_config(group, config):
+ added.append(group)
+ if len(added) > 0:
+ dynamic_store.update_new(added)
except KeyError:
dynamic_store = NegotiatorDynamicGroupConfigValuesStore(self, negotiator, needed_groups, config)
for group in needed_groups:
@@ -168,11 +169,12 @@
try:
static_store = self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id]
static_store.extend_updates()
- added = 0
+ added = []
for group in needed_groups:
- added += static_store.add_group_config(group, config)
- if added > 0:
- static_store.update_new(None)
+ if static_store.add_group_config(group, config):
+ added.append(group)
+ if len(added) > 0:
+ static_store.update_new(added)
except KeyError:
static_store = NegotiatorStaticGroupConfigValuesStore(self, negotiator, needed_groups, config)
self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id] = static_store
@@ -191,7 +193,7 @@
try:
if not self.no_more_updates:
store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
- store.update(None)
+ store.update()
finally:
self.lock.release()
@@ -785,7 +787,7 @@
try:
while self.ticks < 20:
try:
- self.store.update(cursor)
+ self.store.update()
self.store.exception = None
except Exception, e:
log.debug("Object store update failed", exc_info=True)
@@ -802,7 +804,6 @@
self._condition.release()
finally:
conn.close()
-
self.store.delete()
class UpdateTimedOut(Exception):
@@ -814,7 +815,7 @@
self.negotiator = negotiator
- def update(self, cursor):
+ def update(self):
def completion(status, data):
self.status = status
try:
@@ -838,7 +839,7 @@
self.submission = submission
self.machine_name = machine_name
- def update(self, cursor):
+ def update(self):
def completion(status, data):
self.status = status
try:
@@ -875,7 +876,7 @@
self.negotiator = negotiator
- def update(self, cursor):
+ def update(self):
def completion(status, data):
self.status = status
try:
@@ -916,7 +917,7 @@
return added
- def update(self, cursor):
+ def update(self):
for config in self.configs:
action = FetchRawConfigSet()
raw_configs = action.execute(self.model.app.remote,
@@ -930,11 +931,11 @@
# qmfc.status = "OK"
self.data[config] = raw_configs
- def update_new(self, cursor):
+ def update_new(self, added):
for config in self.configs:
action = FetchRawConfigSet()
new_configs = list()
- for group in self.configs[config]:
+ for group in added:
if group not in self.data[config] or \
self.data[config][group].error or \
not self.data[config][group].data:
11 years, 8 months
r5514 - trunk/cumin/python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-18 18:02:31 +0000 (Thu, 18 Oct 2012)
New Revision: 5514
Modified:
trunk/cumin/python/cumin/model.py
Log:
Code for adding missing quota values was wrong. KeyError was raised,
which caused a whole new ObjectStore to be created by the enclosing routine.
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2012-10-17 19:20:29 UTC (rev 5513)
+++ trunk/cumin/python/cumin/model.py 2012-10-18 18:02:31 UTC (rev 5514)
@@ -934,8 +934,8 @@
for config in self.configs:
action = FetchRawConfigSet()
new_configs = list()
- for group in self.configs.keys():
- if group not in self.data.keys() or \
+ for group in self.configs[config]:
+ if group not in self.data[config] or \
self.data[config][group].error or \
not self.data[config][group].data:
new_configs.append(group)
11 years, 8 months
r5513 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-17 19:20:29 +0000 (Wed, 17 Oct 2012)
New Revision: 5513
Modified:
trunk/cumin/python/cumin/stat.py
Log:
Reverting change that spun-up threads to allow simultaneous database queries. This seems to be leaking database connections.
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-10-17 19:07:06 UTC (rev 5512)
+++ trunk/cumin/python/cumin/stat.py 2012-10-17 19:20:29 UTC (rev 5513)
@@ -2,7 +2,6 @@
import logging
from datetime import datetime, timedelta
from time import time, sleep
-import threading
from wooly import Widget, Page, Parameter, Attribute
from wooly.util import StringCatalog, escape_entity, Writer
@@ -1016,16 +1015,9 @@
samples[stat] = ns
else:
- threads = []
for i, stat in enumerate(stats):
- # start a thread to do the db query, etc for each stat requested
- threads.append(threading.Thread(target = self.getStatSamples, args = (adapter, samples, stat, dur, interval, method, end_seconds_ago, delta)))
- threads[i].start()
-
- for th in threads:
- while th.isAlive():
- pass
-
+ self.getStatSamples(adapter, samples, stat, dur, interval, method, end_seconds_ago, delta)
+
return samples
def get_max_min(self, session, stats, samples, time_span=99999, end_seconds_ago=0):
11 years, 8 months
r5512 - in trunk: cumin/python/cumin parsley/python/parsley wooly/python/wooly
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-17 19:07:06 +0000 (Wed, 17 Oct 2012)
New Revision: 5512
Modified:
trunk/cumin/python/cumin/main.py
trunk/cumin/python/cumin/model.py
trunk/parsley/python/parsley/threadingex.py
trunk/wooly/python/wooly/server.py
Log:
Improve shutdown handling for some threads, including the webserver
BZ800065 (modified)
Modified: trunk/cumin/python/cumin/main.py
===================================================================
--- trunk/cumin/python/cumin/main.py 2012-10-17 18:47:13 UTC (rev 5511)
+++ trunk/cumin/python/cumin/main.py 2012-10-17 19:07:06 UTC (rev 5512)
@@ -289,6 +289,12 @@
if self.wallaby is not None:
self.wallaby.stop(wait=True)
+ try:
+ log.info("Stopping update threads")
+ self.model.stop_updates()
+ except:
+ log.debug("Exception stopping update threads")
+
self.server.stop()
try:
self.session.stop()
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2012-10-17 18:47:13 UTC (rev 5511)
+++ trunk/cumin/python/cumin/model.py 2012-10-17 19:07:06 UTC (rev 5512)
@@ -1,5 +1,7 @@
import logging
import os
+import copy
+
from threading import Lock, Thread
from datetime import datetime, timedelta
from time import sleep, mktime
@@ -14,6 +16,7 @@
from rosemary.sqlquery import SqlQueryOptions
from rosemary.model import RosemaryModel
from sage.util import SyncSet
+from parsley.threadingex import CuminBlockingDaemonThread
log = logging.getLogger("cumin.model")
@@ -33,10 +36,37 @@
self.static_group_config_values_by_negotiator = dict()
self.dynamic_group_config_values_by_negotiator = dict()
+ # Disables the creation of further ObjectStore objects
+ # during shutdown when we are trying to terminate the updates
+ self.no_more_updates = False
+
self.lock = Lock()
self.job_meta_data = JobMetaData("job")
+ def stop_updates(self):
+
+ def stop(storedict):
+ for k, v in storedict.iteritems():
+ v.stop_updates()
+
+ self.lock.acquire()
+ self.no_more_updates = True
+
+ # do shallow copy of all the dictionaries
+ # that hold ObjectStore types
+ stores = list()
+ stores.append(copy.copy(self.limits_by_negotiator))
+ stores.append(copy.copy(self.job_summaries_by_submission))
+ stores.append(copy.copy(self.group_names_by_negotiator))
+ stores.append(copy.copy(self.static_group_config_values_by_negotiator))
+ stores.append(copy.copy(self.dynamic_group_config_values_by_negotiator))
+
+ self.lock.release()
+
+ for storedict in stores:
+ stop(storedict)
+
def check(self):
log.info("Checking %s", self)
@@ -84,17 +114,18 @@
return store
self.lock.acquire()
-
try:
try:
- store = self.group_names_by_negotiator[negotiator._qmf_agent_id]
- store.extend_updates()
+ if self.no_more_updates:
+ store = NegotiatorGroupNamesStore(self, None)
+ store.exception = Exception("Shutting down")
+ else:
+ store = self.group_names_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorGroupNamesStore(self, negotiator)
+ self.group_names_by_negotiator[negotiator._qmf_agent_id] = store
store.start_updates()
-
- self.group_names_by_negotiator[negotiator._qmf_agent_id] = store
-
return store
finally:
self.lock.release()
@@ -111,7 +142,12 @@
dynamic_store = None
static_store = None
try:
- if config == "GROUP_QUOTA_DYNAMIC":
+ if self.no_more_updates:
+ dynamic_store = NegotiatorDynamicGroupConfigValuesStore(self, None)
+ dynamic_store.exception = Exception("Shutting down")
+ static_store = NegotiatorStaticGroupConfigValuesStore(self, None)
+ static_store.exception = Exception("Shutting down")
+ elif config == "GROUP_QUOTA_DYNAMIC":
try:
dynamic_store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
dynamic_store.extend_updates()
@@ -124,12 +160,11 @@
dynamic_store = NegotiatorDynamicGroupConfigValuesStore(self, negotiator, needed_groups, config)
for group in needed_groups:
dynamic_store.add_group_config(group, config)
+ self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id] = dynamic_store
dynamic_store.start_updates()
- self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id] = dynamic_store
if(negotiator._qmf_agent_id in self.static_group_config_values_by_negotiator.keys()):
static_store = self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id]
else:
-
try:
static_store = self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id]
static_store.extend_updates()
@@ -140,11 +175,10 @@
static_store.update_new(None)
except KeyError:
static_store = NegotiatorStaticGroupConfigValuesStore(self, negotiator, needed_groups, config)
+ self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id] = static_store
static_store.start_updates()
- self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id] = static_store
if(negotiator._qmf_agent_id in self.dynamic_group_config_values_by_negotiator.keys()):
dynamic_store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
-
return (dynamic_store, static_store)
finally:
self.lock.release()
@@ -154,10 +188,10 @@
return
self.lock.acquire()
-
try:
- store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
- store.update(None)
+ if not self.no_more_updates:
+ store = self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id]
+ store.update(None)
finally:
self.lock.release()
@@ -168,17 +202,18 @@
return store
self.lock.acquire()
-
try:
try:
- store = self.limits_by_negotiator[negotiator._qmf_agent_id]
- store.extend_updates()
+ if self.no_more_updates:
+ store = NegotiatorLimitStore(self, None)
+ store.exception = Exception("Shutting down")
+ else:
+ store = self.limits_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorLimitStore(self, negotiator)
+ self.limits_by_negotiator[negotiator._qmf_agent_id] = store
store.start_updates()
-
- self.limits_by_negotiator[negotiator._qmf_agent_id] = store
-
return store
finally:
self.lock.release()
@@ -190,17 +225,18 @@
return store
self.lock.acquire()
-
try:
try:
- store = self.job_summaries_by_submission[submission._id]
- store.extend_updates()
+ if self.no_more_updates:
+ store = SubmissionJobSummaryStore(self, None)
+ store.exception = Exception("Shutting down")
+ else:
+ store = self.job_summaries_by_submission[submission._id]
+ store.extend_updates()
except KeyError:
store = SubmissionJobSummaryStore(self, submission, machine_name)
+ self.job_summaries_by_submission[submission._id] = store
store.start_updates()
-
- self.job_summaries_by_submission[submission._id] = store
-
return store
finally:
self.lock.release()
@@ -718,6 +754,9 @@
def start_updates(self):
self.update_thread.start()
+ def stop_updates(self, timeout=5):
+ self.update_thread.stop(timeout)
+
def extend_updates(self):
self.update_thread.extend()
@@ -727,12 +766,11 @@
def delete(self):
self.model = None
- class UpdateThread(Thread):
+ class UpdateThread(CuminBlockingDaemonThread):
def __init__(self, store):
- Thread.__init__(self)
+ super(ObjectStore.UpdateThread, self).__init__()
self.store = store
- self.setDaemon(True)
self.ticks = 0
def extend(self):
@@ -754,7 +792,14 @@
self.store.exception = e
self.ticks += 1
- sleep(30)
+ try:
+ self._condition.acquire()
+ if not self.stop_requested:
+ self._condition.wait(30)
+ if self.stop_requested:
+ break
+ finally:
+ self._condition.release()
finally:
conn.close()
Modified: trunk/parsley/python/parsley/threadingex.py
===================================================================
--- trunk/parsley/python/parsley/threadingex.py 2012-10-17 18:47:13 UTC (rev 5511)
+++ trunk/parsley/python/parsley/threadingex.py 2012-10-17 19:07:06 UTC (rev 5512)
@@ -22,3 +22,40 @@
writer.write(row % (cls, name, ident, alive, daemon, extra))
writer.write(os.linesep)
+
+class CuminDaemonThread(Thread):
+ def __init__(self):
+ super(CuminDaemonThread, self).__init__()
+
+ self.name = self.__class__.__name__
+ self.stop_requested = False
+
+ self.setDaemon(True)
+
+ def init(self):
+ pass
+
+ def stop(self, timeout=5):
+ if self.stop_requested:
+ return
+ self.stop_requested = True
+ if self.isAlive():
+ self.join(timeout)
+
+class CuminBlockingDaemonThread(CuminDaemonThread):
+ def __init__(self):
+ super(CuminBlockingDaemonThread, self).__init__()
+
+ self._lock = Lock()
+ self._condition = Condition(self._lock)
+
+ def stop(self, timeout=5):
+ try:
+ self._condition.acquire()
+ self.stop_requested = True
+ self._condition.notify()
+ finally:
+ self._condition.release()
+
+ if self.isAlive():
+ self.join(timeout)
Modified: trunk/wooly/python/wooly/server.py
===================================================================
--- trunk/wooly/python/wooly/server.py 2012-10-17 18:47:13 UTC (rev 5511)
+++ trunk/wooly/python/wooly/server.py 2012-10-17 19:07:06 UTC (rev 5512)
@@ -3,6 +3,7 @@
from util import *
from wooly import *
from wsgiserver import CherryPyWSGIServer
+from parsley.threadingex import CuminBlockingDaemonThread
log = logging.getLogger("wooly.server")
@@ -22,6 +23,7 @@
self.client_sessions_by_id = dict()
self.client_session_expire_thread = ClientSessionExpireThread(self)
+ self.stop_requested = False
def server_alive(self):
return self.dispatch_thread.isAlive()
@@ -53,7 +55,8 @@
def stop(self):
log.info("Stopping %s", self)
-
+ self.stop_requested = True
+ self.client_session_expire_thread.stop()
self.dispatch_thread.stop()
def get_page(self, env):
@@ -75,11 +78,11 @@
return then
def service_request(self, env, response):
- log.info("Request %s %s", env["REQUEST_METHOD"], env["REQUEST_URI"])
-
+ msg = "Request %s %s" % (env["REQUEST_METHOD"], env["REQUEST_URI"])
+ log.info(msg)
page = self.get_page(env)
- if page:
+ if page and not self.stop_requested:
status, headers, content = self.service_page_request(page, env)
else:
status = "404 Not Found"
@@ -247,7 +250,7 @@
self.server = server
self.name = self.__class__.__name__
-
+ self.stopped = False
self.setDaemon(True)
self.wsgi_server = CherryPyWSGIServer \
@@ -255,7 +258,7 @@
self.server.service_request,
request_queue_size=32,
numthreads=32,
- max=32)
+ max=32, shutdown_timeout=0.5)
if self.server.server_cert and self.server.server_key:
ssl_adapter = None
@@ -287,6 +290,9 @@
self.wsgi_server.environ["wsgi.version"] = (1, 1)
+ class MyShutdownException(Exception):
+ pass
+
def run(self):
try:
from ssl import SSLError
@@ -306,15 +312,26 @@
except (SSLError, SSL.Error), e:
log.error("Web server is shutting down from an unhandled SSLError" \
" (problem with the key or certificate?): %s" % e)
- self.wsgi_server.stop()
+ self.stop()
+ except WebServerDispatchThread.MyShutdownException:
+ pass
+
except Exception, e:
log.error("Web server is shutting down from an unhandled" \
" exception: %s" % e)
- self.wsgi_server.stop()
+ self.stop()
def stop(self):
- self.wsgi_server.stop()
+ # The CherryPyWSGIServer will continue to accept connection
+ # requests and spawn worker threads if _set_interrupt() is not
+ # called. The _set_interrupt() method will stop the acceptance
+ # of connection requests and then call stop(). Just calling
+ # stop() here isn't sufficient because stop() may never complete
+ # if connections requests continue to come in.
+ if not self.stopped:
+ self.stopped = True
+ self.wsgi_server._set_interrupt(WebServerDispatchThread.MyShutdownException)
class ClientSession(object):
def __init__(self):
@@ -340,19 +357,23 @@
args = (self.__class__.__name__, self.id, self.created)
return "%s(%s,%s)" % args
-class ClientSessionExpireThread(Thread):
+class ClientSessionExpireThread(CuminBlockingDaemonThread):
def __init__(self, server):
super(ClientSessionExpireThread, self).__init__()
self.server = server
- self.name = self.__class__.__name__
- self.setDaemon(True)
-
def run(self):
while True:
self.expire_sessions()
- time.sleep(60)
+ try:
+ self._condition.acquire()
+ if not self.stop_requested:
+ self._condition.wait(60)
+ if self.stop_requested:
+ break
+ finally:
+ self._condition.release()
def expire_sessions(self):
when = datetime.now() - timedelta(hours=1)
@@ -365,6 +386,4 @@
count += 1
except KeyError:
pass
-
-
log.info("Expired %i client sessions", count)
11 years, 8 months
r5511 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-17 18:47:13 +0000 (Wed, 17 Oct 2012)
New Revision: 5511
Modified:
trunk/cumin/python/cumin/model.py
Log:
Fixing problem in quota config fetching that could cause delays in quotas being reported on screen. We are now adding the config values to be fetched before calling start_updates on the config store.
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2012-10-16 16:40:41 UTC (rev 5510)
+++ trunk/cumin/python/cumin/model.py 2012-10-17 18:47:13 UTC (rev 5511)
@@ -122,8 +122,10 @@
dynamic_store.update_new(None)
except KeyError:
dynamic_store = NegotiatorDynamicGroupConfigValuesStore(self, negotiator, needed_groups, config)
- dynamic_store.start_updates()
- self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id] = dynamic_store
+ for group in needed_groups:
+ dynamic_store.add_group_config(group, config)
+ dynamic_store.start_updates()
+ self.dynamic_group_config_values_by_negotiator[negotiator._qmf_agent_id] = dynamic_store
if(negotiator._qmf_agent_id in self.static_group_config_values_by_negotiator.keys()):
static_store = self.static_group_config_values_by_negotiator[negotiator._qmf_agent_id]
else:
11 years, 8 months
r5510 - trunk/cumin/model/upgrades
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-16 16:40:41 +0000 (Tue, 16 Oct 2012)
New Revision: 5510
Modified:
trunk/cumin/model/upgrades/1.2_to_1.3
Log:
Adding Accountant and Accountant_samples tables to the upgrade path.
Modified: trunk/cumin/model/upgrades/1.2_to_1.3
===================================================================
--- trunk/cumin/model/upgrades/1.2_to_1.3 2012-10-15 15:14:27 UTC (rev 5509)
+++ trunk/cumin/model/upgrades/1.2_to_1.3 2012-10-16 16:40:41 UTC (rev 5510)
@@ -24,6 +24,11 @@
run 'ALTER TABLE \"com.redhat.grid.plumage\".\"OSUtil_samples\" ADD COLUMN usedcpu int8 NOT NULL DEFAULT 0'
run 'ALTER TABLE \"com.redhat.grid.plumage\".\"OSUtil_samples\" ADD COLUMN availcpu int8 NOT NULL DEFAULT 0'
run 'ALTER TABLE \"com.redhat.grid.plumage\".\"OSUtil_samples\" ADD COLUMN totalcpu int8 NOT NULL DEFAULT 0'
+
+run 'create sequence \"com.redhat.grid.plumage\".\"Accountant_id_seq\"'
+run 'CREATE TABLE \"com.redhat.grid.plumage\".\"Accountant\" \(\"_id\" bigint NOT NULL,\"host\" text NOT NULL,\"user\" text,\"agroup\" text,\"ts\" timestamp without time zone,\"prio\" real,\"wresused\" bigint,\"resused\" bigint,\"cquota\" real,\"equota\" real,\"squota\" real,\"wausage\" bigint,CONSTRAINT \"Accountant_pk\" PRIMARY KEY \(\"_id\"\)\)'
+run 'CREATE TABLE \"com.redhat.grid.plumage\".\"Accountant_samples\" \(\"user\" text NOT NULL,\"agroup\" text,\"ts\" timestamp without time zone NOT NULL,\"prio\" real,\"wresused\" bigint,\"resused\" bigint,\"cquota\" real,\"equota\" real,\"squota\" real,\"wausage\" bigint\)'
+
run 'DROP TABLE \"com.redhat.cumin\".\"BrokerGroup\" cascade'
run 'DROP TABLE \"com.redhat.cumin\".\"BrokerGroup_samples\" cascade'
run 'DROP TABLE \"com.redhat.cumin\".\"BrokerGroupMapping\" cascade'
11 years, 8 months