setup.py start-moksha
by Luke Macken
setup.py | 4 ++--
start-moksha | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 7a6ca8007e1c261516fef2b901543301fc2d663b
Author: Luke Macken <luke(a)civx.us>
Date: Tue Mar 29 18:30:33 2011 -0400
Remove egg requirements on a couple of packages that lack egg-info on RHEL5
diff --git a/setup.py b/setup.py
index d679380..63fb211 100644
--- a/setup.py
+++ b/setup.py
@@ -36,10 +36,10 @@ setup(
"Sphinx",
"Paver",
"tw.forms",
- "pytz",
+ #"pytz",
"Babel",
"pyOpenSSL",
- "BeautifulSoup",
+ #"BeautifulSoup",
"python-daemon",
"repoze.what-quickstart",
"repoze.what-pylons",
diff --git a/start-moksha b/start-moksha
index 5938070..e7826a5 100755
--- a/start-moksha
+++ b/start-moksha
@@ -13,6 +13,8 @@ if [ ! $VIRTUAL_ENV ]; then
source tg2env/bin/activate
# HACK: http://groups.google.com/group/turbogears/browse_thread/thread/0176623b98...
+ easy_install pytz
+ easy_install BeautifulSoup
easy_install Extremes
easy_install -i http://www.turbogears.org/2.1/downloads/current/index tg.devtools
#easy_install -i http://www.turbogears.org/2.0/downloads/current/index tg.devtools
13 years, 1 month
Branch 'dev' - start-moksha
by Luke Macken
start-moksha | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit d4b63fbe779c3d45c8ec10ab972e82f012c015c4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 16 23:07:55 2011 -0400
Also link in mllib for qpid if it's available
diff --git a/start-moksha b/start-moksha
index 5938070..0a833c7 100755
--- a/start-moksha
+++ b/start-moksha
@@ -66,6 +66,9 @@ if [ ! $VIRTUAL_ENV ]; then
if [ -d /usr/lib/python*/site-packages/qpid ]; then
ln -s /usr/lib/python*/site-packages/qpid tg2env/lib/python*/site-packages/
fi
+ if [ -d /usr/lib/python*/site-packages/mllib ]; then
+ ln -s /usr/lib/python*/site-packages/mllib tg2env/lib/python*/site-packages/
+ fi
else
source tg2env/bin/activate
fi
13 years, 2 months
Branch 'dev' - moksha/templates
by Luke Macken
moksha/templates/widget.mak | 4 ++--
moksha/templates/widgets.mak | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit e26a8a927d3f8e12092de1d9462c21efe5aa9bd6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 16 18:37:45 2011 -0400
Render our widgets with .display() to be TW1 and TW2 compat
diff --git a/moksha/templates/widget.mak b/moksha/templates/widget.mak
index c3ab842..0203691 100644
--- a/moksha/templates/widget.mak
+++ b/moksha/templates/widget.mak
@@ -1,9 +1,9 @@
<html>
<head></head>
- <body>${tmpl_context.widget(**options)}</body>
+ <body>${tmpl_context.widget.display(**options)}</body>
% if hasattr(tmpl_context, 'moksha_socket') and not isinstance(tmpl_context.moksha_socket, basestring) :
- ${tmpl_context.moksha_socket()}
+ ${tmpl_context.moksha_socket.display()}
% endif
</html>
diff --git a/moksha/templates/widgets.mak b/moksha/templates/widgets.mak
index e636937..ea87a80 100644
--- a/moksha/templates/widgets.mak
+++ b/moksha/templates/widgets.mak
@@ -4,12 +4,12 @@
</head>
<body>
% for widget in tmpl_context.widgets:
- ${widget(**options.get(widget, dict()))}
+ ${widget.display(**options.get(widget, dict()))}
% endfor
</body>
% if tmpl_context.moksha_socket:
- ${tmpl_context.moksha_socket()}
+ ${tmpl_context.moksha_socket.display()}
% endif
</html>
13 years, 2 months
moksha/apps
by Luke Macken
moksha/apps/metrics/moksha/apps/metrics/streams/metrics_stream.py | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit b2c5fd99eb6d48fe89778adc2e54f96f03f225c6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 16:50:56 2011 -0400
Make the Metrics data producer configurable
diff --git a/moksha/apps/metrics/moksha/apps/metrics/streams/metrics_stream.py b/moksha/apps/metrics/moksha/apps/metrics/streams/metrics_stream.py
index e841f30..ab4c59a 100644
--- a/moksha/apps/metrics/moksha/apps/metrics/streams/metrics_stream.py
+++ b/moksha/apps/metrics/moksha/apps/metrics/streams/metrics_stream.py
@@ -15,11 +15,17 @@
# limitations under the License.
import os
+import logging
import subprocess
+from tg import config
+from paste.deploy.converters import asbool
+
from moksha.lib.helpers import defaultdict
from moksha.api.streams import PollingDataStream
+log = logging.getLogger('moksha.hub')
+
PID = 0
NAME = -1
MEM_TOTAL = -2
@@ -36,6 +42,9 @@ class MokshaMetricsDataStream(PollingDataStream):
poll_for_new_pids = False
def __init__(self):
+ if not asbool(config.get('moksha.metrics_stream', False)):
+ log.info('Moksha Metrics Stream disabled')
+ return
self.programs = self._find_programs()
self.processors = self._find_processors()
super(MokshaMetricsDataStream, self).__init__()
13 years, 2 months
start-moksha
by Luke Macken
start-moksha | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit ffe090403ed1ccb97366d6b8681220df5a3d90c2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 16:21:30 2011 -0400
Tweak start-moksha to work with newer versions of Shove
diff --git a/start-moksha b/start-moksha
index 0e9e847..5938070 100755
--- a/start-moksha
+++ b/start-moksha
@@ -19,7 +19,9 @@ if [ ! $VIRTUAL_ENV ]; then
# Hack around Shove's hard SQLAlchemy requirement :(
easy_install -U Shove
- sed -i -e 's/SQLAlchemy==0\.4/SQLAlchemy/' tg2env/lib/python*/site-packages/shove-*.egg/EGG-INFO/requires.txt
+ if [ -f tg2env/lib/python*/site-packages/shove-*.egg/EGG-INFO/requires.txt ]; then
+ sed -i -e 's/SQLAlchemy==0\.4/SQLAlchemy/' tg2env/lib/python*/site-packages/shove-*.egg/EGG-INFO/requires.txt
+ fi
easy_install -U SQLAlchemy
easy_install Paver
easy_install Twisted
13 years, 2 months
setup.py
by Luke Macken
setup.py | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 0eb213591d4eaac90aa15e2857e59d8c66d7ed27
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 16:02:35 2011 -0400
Require bunch
diff --git a/setup.py b/setup.py
index 64ce716..d679380 100644
--- a/setup.py
+++ b/setup.py
@@ -44,6 +44,7 @@ setup(
"repoze.what-quickstart",
"repoze.what-pylons",
"repoze.tm2",
+ "Bunch",
"Mako",
"Genshi",
#"repoze.squeeze", # Not hard requirements
13 years, 2 months
docs/main
by Luke Macken
docs/main/FeedStream.rst | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 15887a7aa3825541319aab49bbdd9de4dd7e7c0f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 15:47:24 2011 -0400
Document our new feed strema knob
diff --git a/docs/main/FeedStream.rst b/docs/main/FeedStream.rst
index 89a6741..8287034 100644
--- a/docs/main/FeedStream.rst
+++ b/docs/main/FeedStream.rst
@@ -37,6 +37,9 @@ The feed app can be configured with the following options in your config file:
.. code-block:: python
+ # Enable the feed aggregator in the moksha-hub
+ moksha.feedaggregator = True
+
# Number of seconds between polling feeds
feed.poll_frequency = 900
13 years, 2 months
4 commits - moksha/api moksha/apps moksha/hub start-moksha
by Luke Macken
moksha/api/streams/datastream.py | 8 +++++---
moksha/apps/feeds/moksha/apps/feeds/streams.py | 10 ++++++++--
moksha/hub/amqp/__init__.py | 9 +++------
start-moksha | 5 +++++
4 files changed, 21 insertions(+), 11 deletions(-)
New commits:
commit fd1d8f6ee71849bd76a80e8cf6bac409fe6d1189
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 15:45:16 2011 -0400
Allow people to disable the moksha feed aggregation stream with the
moksha.feedaggregator variable in your ini
diff --git a/moksha/apps/feeds/moksha/apps/feeds/streams.py b/moksha/apps/feeds/moksha/apps/feeds/streams.py
index f892da5..912f809 100644
--- a/moksha/apps/feeds/moksha/apps/feeds/streams.py
+++ b/moksha/apps/feeds/moksha/apps/feeds/streams.py
@@ -29,6 +29,7 @@ except ImportError:
from twisted.web import client
from twisted.web.client import HTTPPageGetter, HTTPClientFactory
from twisted.internet import reactor, protocol, defer
+from paste.deploy.converters import asbool
from datetime import timedelta
from feedcache import Cache
@@ -294,10 +295,15 @@ class MokshaFeedStream(PollingDataStream):
AMQP messages will be sent to the `feeds.$URL` queue.
"""
#frequency = timedelta(minutes=1)
- now = True
+ now = False
def __init__(self):
- self.frequency = int(config.get('feed.poll_frequency', 900))
+ enabled = asbool(config.get('moksha.feedaggregator', False))
+ if not enabled:
+ log.info('Moksha Feed Aggregator disabled')
+ return
+ else:
+ self.frequency = int(config.get('feed.poll_frequency', 900))
super(MokshaFeedStream, self).__init__()
def poll(self):
commit 1c1c3678b5cfae6ed189d28e3a5ee0b5276b52d3
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 15:44:58 2011 -0400
Make our datastream shutdown procedures more robust
diff --git a/moksha/api/streams/datastream.py b/moksha/api/streams/datastream.py
index 5c10e0e..0de9514 100644
--- a/moksha/api/streams/datastream.py
+++ b/moksha/api/streams/datastream.py
@@ -46,8 +46,9 @@ class DataStream(object):
log.error('Cannot send message: %s' % e)
def stop(self):
- self.hub.close()
- if self.DBSession:
+ if hasattr(self, 'hub') and self.hub:
+ self.hub.close()
+ if hasattr(self, 'DBSession') and self.DBSession:
self.DBSession.close()
@@ -78,6 +79,7 @@ class PollingDataStream(DataStream):
def stop(self):
super(PollingDataStream, self).stop()
try:
- self.timer.stop()
+ if hasattr(self, 'timer'):
+ self.timer.stop()
except Exception, e:
self.log.warn(e)
commit d89e701c2cc9151b636642f7f3c4806a0e118c18
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 13:14:15 2011 -0400
If we're using a virtualenv and have python-qpid installed, symlink it in
diff --git a/start-moksha b/start-moksha
index 1514fbe..0e9e847 100755
--- a/start-moksha
+++ b/start-moksha
@@ -59,6 +59,11 @@ if [ ! $VIRTUAL_ENV ]; then
#./pip.py install -E tg2env -r normal-reqs.txt --extra-index-url=http://www.turbogears.org/2.0/downloads/current/index
#easy_install -i http://www.turbogears.org/2.0/downloads/current/index tg.devtools
#pushd moksha/widgetbrowser; python setup.py develop; popd
+
+ # Link the python-qpid modules into our virtualenv, if they exist
+ if [ -d /usr/lib/python*/site-packages/qpid ]; then
+ ln -s /usr/lib/python*/site-packages/qpid tg2env/lib/python*/site-packages/
+ fi
else
source tg2env/bin/activate
fi
commit bf12bec884f8a27acef88b6f089efb13036483c8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 15 13:13:55 2011 -0400
Warn if we are trying to use AMQP but can't import qpid
diff --git a/moksha/hub/amqp/__init__.py b/moksha/hub/amqp/__init__.py
index 98ada27..8bed9af 100644
--- a/moksha/hub/amqp/__init__.py
+++ b/moksha/hub/amqp/__init__.py
@@ -16,20 +16,17 @@
"""
Here is where we configure which AMQP hub implementation we are going to use.
"""
-import logging
-log = logging.getLogger(__name__)
-
try:
from qpid010 import QpidAMQPHub
AMQPHub = QpidAMQPHub
except ImportError:
- log.debug("Cannot find qpid python module")
+ print("Cannot find qpid python module. Make sure you have python-qpid installed.")
try:
from pyamqplib import AMQPLibHub
AMQPHub = AMQPLibHub
except ImportError:
- log.debug("Cannot find pyamqplib")
- log.debug("Using FakeHub AMQP broker. Don't expect AMQP to work")
+ print("Cannot find pyamqplib")
+ print("Using FakeHub AMQP broker. Don't expect AMQP to work")
class FakeHub(object):
pass
AMQPHub = FakeHub
13 years, 2 months