rhmessaging commits: r2039 - store/branches/java.
by rhmessaging-commits@lists.jboss.org
Author: godfrer
Date: 2008-05-13 05:29:57 -0400 (Tue, 13 May 2008)
New Revision: 2039
Added:
store/branches/java/broker-queue-refactor/
Log:
Create bdb store branch for refactored broker
Copied: store/branches/java/broker-queue-refactor (from rev 2038, store/branches/java/M2.1)
17 years, 11 months
rhmessaging commits: r2038 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-12 17:26:45 -0400 (Mon, 12 May 2008)
New Revision: 2038
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/jrnl/enq_rec.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Fixed intermittent core on shutdown after reads from store. Addresses one of the issues in BZ446096
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-05-12 17:23:00 UTC (rev 2037)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-05-12 21:26:45 UTC (rev 2038)
@@ -104,6 +104,7 @@
if (_xidp) {
::free(_xidp);
_xidp = 0;
+ _datap = 0;
} else if (_datap) {
::free(_datap);
_datap = 0;
@@ -231,6 +232,7 @@
if (_xidp) {
::free(_xidp);
_xidp = 0;
+ _datap = 0;
} else if (_datap) {
::free(_datap);
_datap = 0;
Modified: store/trunk/cpp/lib/jrnl/enq_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_rec.cpp 2008-05-12 17:23:00 UTC (rev 2037)
+++ store/trunk/cpp/lib/jrnl/enq_rec.cpp 2008-05-12 21:26:45 UTC (rev 2038)
@@ -512,7 +512,7 @@
std::size_t
enq_rec::get_xid(void** const xidpp)
{
- if (!_buff)
+ if (!_buff || !_enq_hdr._xidsize)
{
*xidpp = 0;
return 0;
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-05-12 17:23:00 UTC (rev 2037)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-05-12 21:26:45 UTC (rev 2038)
@@ -392,6 +392,10 @@
* present (ie an empty record), then no memory is allocated, and both pointers will be NULL.
* In this case, there is no need to free memory.
*
+ * TODO: Fix this lousy interface. The caller should NOT be required to clean up these
+ * pointers! Rather use a struct, or better still, let the data token carry the data and
+ * xid pointers and lengths, and have the data token both allocate and delete.
+ *
* \param datapp Pointer to pointer that will be set to point to memory allocated and
* containing the data. Will be set to NULL if the call fails or there is no data
* in the record.
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-12 17:23:00 UTC (rev 2037)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-12 21:26:45 UTC (rev 2038)
@@ -124,6 +124,8 @@
external = _enq_rec.is_external();
return res;
}
+
+ set_params_null(datapp, dsize, xidpp, xidsize);
_hdr.reset();
// Read header, determine next record type
while (true)
17 years, 11 months
rhmessaging commits: r2037 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-05-12 13:23:00 -0400 (Mon, 12 May 2008)
New Revision: 2037
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
Log:
Added store support for general configuration items (used for qpid federation)
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-12 17:23:00 UTC (rev 2037)
@@ -64,6 +64,7 @@
messageDb(&env, 0),
mappingDb(&env, 0),
bindingDb(&env, 0),
+ generalDb(&env, 0),
enqueueXidDb(&env, 0),
dequeueXidDb(&env, 0),
prepareXidDb(&env, 0),
@@ -149,6 +150,7 @@
open(messageDb, txn.get(), "messages.db", false);
open(mappingDb, txn.get(), "mappings.db", true);
open(bindingDb, txn.get(), "bindings.db", true);
+ open(generalDb, txn.get(), "general.db", false);
open(enqueueXidDb, txn.get(), "enqueue_xid.db", true);
open(dequeueXidDb, txn.get(), "dequeue_xid.db", true);
open(prepareXidDb, txn.get(), "prepare_xid.db", false);
@@ -416,6 +418,28 @@
bindingDb.del(0, &key, DB_AUTO_COMMIT);
}
+void BdbMessageStore::create(const PersistableConfig& general)
+{
+ checkInit();
+ if (general.getPersistenceId()) {
+ THROW_STORE_EXCEPTION("General configuration item already created");
+ }
+
+ try {
+ if (!create(generalDb, generalIdSequence, general)) {
+ THROW_STORE_EXCEPTION("General configuration already exists");
+ }
+ } catch (const DbException& e) {
+ THROW_STORE_EXCEPTION_2("Error creating general configuration", e);
+ }
+}
+
+void BdbMessageStore::destroy(const PersistableConfig& general)
+{
+ checkInit();
+ destroy(generalDb, general);
+}
+
bool BdbMessageStore::create(Db& db, IdSequence& seq, const Persistable& p)
{
u_int64_t id (seq.next());
@@ -477,6 +501,9 @@
recoverExchanges(txn, registry, exchanges);
recoverBindings(txn, exchanges, queues);
+ //recover general-purpose configuration
+ recoverGeneral(txn, registry);
+
txn.commit();
} catch (const DbException& e) {
@@ -613,6 +640,26 @@
}
}
+void BdbMessageStore::recoverGeneral(TxnCtxt& txn, RecoveryManager& registry)
+{
+ Cursor items;
+ items.open(generalDb, txn.get());
+
+ u_int64_t maxGeneralId(1);
+ IdDbt key;
+ Dbt value;
+ //read all items
+ while (items.next(key, value)) {
+ Buffer buffer(reinterpret_cast<char*>(value.get_data()), value.get_size());
+ //create instance
+ RecoverableConfig::shared_ptr config = registry.recoverConfig(buffer);
+ //set the persistenceId and update max as required
+ config->setPersistenceId(key.id);
+ maxGeneralId = max(key.id, maxGeneralId);
+ }
+ generalIdSequence.reset(maxGeneralId + 1);
+}
+
// async IO version.
void BdbMessageStore::recoverMessages(TxnCtxt& /*txn*/, qpid::broker::RecoveryManager& recovery,
qpid::broker::RecoverableQueue::shared_ptr& queue, txn_list& locked, message_index& prepared)
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2008-05-12 17:23:00 UTC (rev 2037)
@@ -82,11 +82,13 @@
Db messageDb;
Db mappingDb;
Db bindingDb;
+ Db generalDb;
Db enqueueXidDb;
Db dequeueXidDb;
Db prepareXidDb;
IdSequence queueIdSequence;
IdSequence exchangeIdSequence;
+ IdSequence generalIdSequence;
IdSequence messageIdSequence;
static bool useAsync;
std::string storeDir;
@@ -113,6 +115,7 @@
uint64_t mId, unsigned& headerSize);
void recoverExchanges(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery, exchange_index& index);
void recoverBindings(TxnCtxt& txn, exchange_index& exchanges, queue_index& queues);
+ void recoverGeneral(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery);
int enqueueMessage(TxnCtxt& txn, IdDbt& msgId, qpid::broker::RecoverableMessage::shared_ptr& msg,
queue_index& index, txn_list& locked, message_index& prepared);
void recoverXids(txn_list& txns);
@@ -194,6 +197,9 @@
const qpid::broker::PersistableQueue& queue,
const std::string& key, const qpid::framing::FieldTable& args);
+ void create(const qpid::broker::PersistableConfig& config);
+ void destroy(const qpid::broker::PersistableConfig& config);
+
void recover(qpid::broker::RecoveryManager& queues);
void stage(boost::intrusive_ptr<qpid::broker::PersistableMessage>& msg);
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2008-05-12 17:23:00 UTC (rev 2037)
@@ -96,9 +96,10 @@
store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
store->init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
+ LinkRegistry links(0);
DtxManager mgr;
mgr.setStore (store.get());
- RecoveryManagerImpl recoveryMgr(queues, exchanges, mgr, 0);
+ RecoveryManagerImpl recoveryMgr(queues, exchanges, links, mgr, 0);
store->recover(recoveryMgr);
queue = queues.find(name);
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2008-05-12 17:23:00 UTC (rev 2037)
@@ -60,24 +60,26 @@
}
};
-void recover(BdbMessageStore& store, QueueRegistry& queues, ExchangeRegistry& exchanges)
+void recover(BdbMessageStore& store, QueueRegistry& queues, ExchangeRegistry& exchanges, LinkRegistry& links)
{
DtxManager mgr;
mgr.setStore (&store);
- RecoveryManagerImpl recovery(queues, exchanges, mgr, 0);
+ RecoveryManagerImpl recovery(queues, exchanges, links, mgr, 0);
store.recover(recovery);
}
void recover(BdbMessageStore& store, ExchangeRegistry& exchanges)
{
QueueRegistry queues;
- recover(store, queues, exchanges);
+ LinkRegistry links(0);
+ recover(store, queues, exchanges, links);
}
void recover(BdbMessageStore& store, QueueRegistry& queues)
{
ExchangeRegistry exchanges;
- recover(store, queues, exchanges);
+ LinkRegistry links(0);
+ recover(store, queues, exchanges, links);
}
void testCreateDelete(bool async)
@@ -331,9 +333,10 @@
QueueRegistry registry;
registry.setStore (&store);
ExchangeRegistry exchanges;
+ LinkRegistry links(0);
DtxManager dtx;
dtx.setStore (&store);
- RecoveryManagerImpl recovery(registry, exchanges, dtx, 10);
+ RecoveryManagerImpl recovery(registry, exchanges, links, dtx, 10);
store.recover(recovery);
//get message instance from queue
@@ -487,8 +490,9 @@
store.init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
+ LinkRegistry links(0);
- recover(store, queues, exchanges);
+ recover(store, queues, exchanges, links);
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
Queue::shared_ptr queue = queues.find(queueName);
@@ -501,8 +505,9 @@
store.init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
+ LinkRegistry links(0);
- recover(store, queues, exchanges);
+ recover(store, queues, exchanges, links);
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
Queue::shared_ptr queue = queues.find(queueName);
@@ -551,9 +556,10 @@
store.init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
+ LinkRegistry links(0);
//ensure recovery works ok:
- recover(store, queues, exchanges);
+ recover(store, queues, exchanges, links);
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
BOOST_REQUIRE(!queues.find(queueName1).get());
@@ -567,9 +573,10 @@
store.init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
+ LinkRegistry links(0);
//ensure recovery works ok:
- recover(store, queues, exchanges);
+ recover(store, queues, exchanges, links);
try {
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2008-05-12 17:23:00 UTC (rev 2037)
@@ -84,9 +84,10 @@
store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
store->init(TESTDIR, async, false, 4, 1, 8);
ExchangeRegistry exchanges;
+ LinkRegistry links(0);
DtxManager mgr;
mgr.setStore (store.get());
- RecoveryManagerImpl recovery(queues, exchanges, mgr, 0);
+ RecoveryManagerImpl recovery(queues, exchanges, links, mgr, 0);
store->recover(recovery);
queueA = queues.find(nameA);
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-05-12 16:32:14 UTC (rev 2036)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-05-12 17:23:00 UTC (rev 2037)
@@ -128,6 +128,7 @@
std::auto_ptr<BdbMessageStore> store;
std::auto_ptr<DtxManager> dtxmgr;
QueueRegistry queues;
+ LinkRegistry links;
Queue::shared_ptr queueA;
Queue::shared_ptr queueB;
Message::shared_ptr msg1;
@@ -250,7 +251,7 @@
ExchangeRegistry exchanges;
dtxmgr = std::auto_ptr<DtxManager>(new DtxManager);
dtxmgr->setStore (store.get());
- RecoveryManagerImpl recovery(queues, exchanges, *dtxmgr, 0);
+ RecoveryManagerImpl recovery(queues, exchanges, links, *dtxmgr, 0);
store->recover(recovery);
queueA = queues.find(nameA);
@@ -292,7 +293,7 @@
}
public:
- TwoPhaseCommitTest() : nameA("queueA"), nameB("queueB") {}
+ TwoPhaseCommitTest() : nameA("queueA"), nameB("queueB"), links(0) {}
void testCommitSwap(bool a)
{
17 years, 11 months
rhmessaging commits: r2036 - mgmt/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-12 12:32:14 -0400 (Mon, 12 May 2008)
New Revision: 2036
Added:
mgmt/bin/cumin-rpm-build
Log:
A script to build the cumin rpm using the distcvs spec file
Added: mgmt/bin/cumin-rpm-build
===================================================================
--- mgmt/bin/cumin-rpm-build (rev 0)
+++ mgmt/bin/cumin-rpm-build 2008-05-12 16:32:14 UTC (rev 2036)
@@ -0,0 +1,26 @@
+#!/bin/bash -e
+
+if [ -z "$1" ]; then
+ echo "Usage: cumin-rpm-build SOURCE-TARBALL"
+ exit 1
+fi
+
+tarball=$1
+topdir="/tmp/cumin-rpm-build-${RANDOM}"
+
+echo "Building in tmp dir $topdir"
+
+mkdir "$topdir"
+cd "$topdir"
+mkdir SPECS SRPMS SOURCES RPMS BUILD
+
+cp "$tarball" "${topdir}/SOURCES"
+
+wget "http://cvs.devel.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/rpms/cumin/RHEL..." -O cumin.spec.in
+
+version=$(basename "$tarball" | cut -d . -f 3)
+#version=$(expr match "$tarball" '\(.[0-9]+\)')
+
+sed -e "$(printf 's/^Version:.*$/Version: 0.1.%s/' "$version")" cumin.spec.in > SPECS/cumin.spec
+
+rpmbuild --define "_topdir $topdir" -ba SPECS/cumin.spec
Property changes on: mgmt/bin/cumin-rpm-build
___________________________________________________________________
Name: svn:executable
+ *
17 years, 11 months
rhmessaging commits: r2034 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-09 16:41:11 -0400 (Fri, 09 May 2008)
New Revision: 2034
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Fix for RHEL4: ifstream::close() does not reset error flags, must explicitly clear them before next ifstream::open()
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-09 19:05:15 UTC (rev 2033)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-09 20:41:11 UTC (rev 2034)
@@ -839,6 +839,7 @@
{
rd._eo = ifsp->tellg(); // remember file offset before closing
ifsp->close();
+ ifsp->clear(); // clear eof flag, req'd for older versions of c++
if (++fid >= _num_jfiles)
{
fid = 0;
17 years, 11 months
rhmessaging commits: r2033 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-09 15:05:15 -0400 (Fri, 09 May 2008)
New Revision: 2033
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokerprofile.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/system.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/cumin/widgets.py
Log:
Use model methods to uniformly control object titles.
Use fmt_shorten by default for object names.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/broker.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -222,9 +222,6 @@
self.page.set_current_frame(session, self.__clients_close)
return self.show_mode(session, self.__clients_close)
- def render_title(self, session, broker):
- return "Broker '%s'" % broker.name
-
class BrokerStatus(CuminStatus):
pass
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/brokercluster.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -66,9 +66,6 @@
self.broker.set_object(session, broker)
return self.show_mode(session, self.broker)
- def render_title(self, session, cluster):
- return "Broker Cluster '%s'" % cluster.name
-
class BrokerClusterStatus(CuminStatus):
pass
@@ -85,12 +82,6 @@
self.tabs.add_tab(self.ClusterBrokerTab(app, "brokers"))
self.tabs.add_tab(self.ClusterStatsTab(app, "stats"))
- def render_title(self, session, cluster):
- return "Broker Cluster '%s'" % cluster.name
-
- def render_name(self, session, cluster):
- return cluster.name
-
class ClusterBrokerTab(BrokerSet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/brokergroup.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -97,12 +97,10 @@
def render_title(self, session, group):
if group:
- title = "Broker Group '%s'" % group.name
+ return super(BrokerGroupFrame, self).render_title(session, group)
else:
- title = "Broker Group"
+ return "Broker Group"
- return title
-
def render_href(self, session, group):
if group:
return super(BrokerGroupFrame, self).render_href(session, group)
Modified: mgmt/cumin/python/cumin/brokerprofile.py
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/brokerprofile.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -47,9 +47,6 @@
self.add_mode(remove)
self.set_remove_mode(remove)
- def render_title(self, session, profile):
- return "Broker Profile '%s'" % profile.name
-
class BrokerProfileView(CuminView):
def __init__(self, app, name):
super(BrokerProfileView, self).__init__(app, name)
@@ -60,12 +57,6 @@
self.tabs.add_tab(self.ProfileConfigTab(app, "config"))
self.tabs.add_tab(self.ProfileBrokerTab(app, "brokers"))
- def render_title(self, session, profile):
- return "Broker Profile '%s'" % profile.name
-
- def render_name(self, session, profile):
- return profile.name
-
class ProfileConfigTab(ConfigPropertySet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/client.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -135,9 +135,6 @@
def show_sessions_close(self, session):
return self.show_mode(session, self.__sessions_close)
- def render_title(self, session, client):
- return "Client %s" % client.address
-
# XXX get rid of this
def doit(error, args):
pass
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/exchange.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -167,8 +167,10 @@
self.set_view_mode(view)
def render_title(self, session, exchange):
- return exchange.name and "Exchange '%s'" % exchange.name \
- or "Default Exchange"
+ if exchange.name:
+ return super(ExchangeFrame, self).render_title(session, exchange)
+ else:
+ return "Default Exchange"
class ExchangeStatus(CuminStatus):
def render_messages_received(self, session, exchange):
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/model.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -333,7 +333,7 @@
def get_object_title(self, session, object):
title = self.get_title(session)
name = self.get_object_name(object)
- return "%s '%s'" % (title, name)
+ return "%s '%s'" % (title, fmt_shorten(name))
def get_object_name(self, object):
return object.name
@@ -697,7 +697,7 @@
def get_title(self, session):
return "Queue"
-
+
def get_icon_href(self, session):
return "resource?name=queue-36.png"
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/queue.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -189,7 +189,7 @@
def render_title(self, session, queue):
if queue:
- return "Queue '%s'" % queue.name
+ return super(QueueFrame, self).render_title(session, queue)
else:
return "Queue"
Modified: mgmt/cumin/python/cumin/system.py
===================================================================
--- mgmt/cumin/python/cumin/system.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/system.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -45,9 +45,6 @@
self.add_mode(view)
self.set_view_mode(view)
- def render_title(self, session, system):
- return "System '%s'" % system.sysId
-
class SystemStatus(CuminStatus):
pass
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/virtualhost.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -56,9 +56,6 @@
self.__client.set_object(session, client)
return self.show_mode(session, self.__client)
- def render_title(self, session, vhost):
- return "Functional Host '%s'" % vhost.name
-
class VirtualHostView(CuminView):
def __init__(self, app, name):
super(VirtualHostView, self).__init__(app, name)
@@ -70,12 +67,6 @@
self.tabs.add_tab(ExchangeSet(app, "exchanges"))
self.tabs.add_tab(ClientSet(app, "clients"))
- def render_title(self, session, vhost):
- return "Functional Host '%s'" % vhost.name
-
- def render_name(self, session, vhost):
- return vhost.name
-
def render_broker_link(self, session, vhost):
broker = vhost.get_broker()
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-05-09 17:58:50 UTC (rev 2032)
+++ mgmt/cumin/python/cumin/widgets.py 2008-05-09 19:05:15 UTC (rev 2033)
@@ -80,6 +80,15 @@
self.show_view(branch)
return branch.marshal()
+ def render_title(self, session, *args):
+ obj = self.get_object(session)
+
+ assert obj
+
+ cls = self.app.model.get_class_by_object(obj)
+
+ return cls.get_object_title(session, obj)
+
class CuminView(Widget):
def __init__(self, app, name):
super(CuminView, self).__init__(app, name)
17 years, 11 months
rhmessaging commits: r2032 - in store/trunk/cpp: lib and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-09 13:58:50 -0400 (Fri, 09 May 2008)
New Revision: 2032
Modified:
store/trunk/cpp/configure.ac
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
store/trunk/cpp/tests/jrnl/jtt/args.cpp
store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
Log:
Patch from Michael Goulish: Changes to allow compilation of store module on RHEL4
Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/configure.ac 2008-05-09 17:58:50 UTC (rev 2032)
@@ -117,17 +117,17 @@
AC_SUBST([LIB_DLOPEN])
LIBS=$gl_saved_libs
-# Require libdb_cxx-4.3, for the library, and for db_cxx.h.
+# Require libdb_cxx (any version between 4.2 and 4.6), for the library, and for db_cxx.h.
db4_devel_fail=0
AC_CHECK_HEADER([db_cxx.h], ,[db4_devel_fail=1])
test $db4_devel_fail == 1 && \
AC_MSG_ERROR([db4-devel package missing. Please ensure both db4 and db4-devel are installed. (hint: "yum install db4-devel" should do it...)])
gl_saved_libs=$LIBS
-AC_SEARCH_LIBS([__db_open], [db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3],
+AC_SEARCH_LIBS([__db_open], [db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3 db_cxx-4.2],
[test "$ac_cv_search___db_open" = "none required" ||
LIB_BERKELEY_DB=$ac_cv_search___db_open],
- AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.3 through db_cxx-4.6]))
+ AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.2 through db_cxx-4.6]))
AC_SUBST([LIB_BERKELEY_DB])
LIBS=$gl_saved_libs
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2008-05-09 17:58:50 UTC (rev 2032)
@@ -45,6 +45,12 @@
#include <boost/ptr_container/ptr_list.hpp>
#include "qpid/management/Store.h"
+// Assume DB_VERSION_MAJOR == 4
+#if (DB_VERSION_MINOR == 2)
+#include <errno.h>
+#define DB_BUFFER_SMALL ENOMEM
+#endif
+
namespace rhm {
namespace bdbstore {
using std::string;
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2008-05-09 17:58:50 UTC (rev 2032)
@@ -80,7 +80,7 @@
Message::shared_ptr msg = queue->dequeue().payload;
if (msg) {
queue->dequeue(0, msg);
- BOOST_REQUIRE_EQUAL(ids.front(), msg->getProperties<MessageProperties>()->getMessageId());
+ BOOST_CHECK_EQUAL(ids.front(), msg->getProperties<MessageProperties>()->getMessageId());
ids.pop();
return true;
} else {
@@ -107,10 +107,10 @@
void check()
{
BOOST_REQUIRE(queue);
- BOOST_REQUIRE_EQUAL((u_int32_t) ids.size(), queue->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) ids.size(), queue->getMessageCount());
while (pop()) ;//keeping popping 'till all messages are dequeued
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, queue->getMessageCount());
- BOOST_REQUIRE_EQUAL((size_t) 0, ids.size());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, queue->getMessageCount());
+ BOOST_CHECK_EQUAL((size_t) 0, ids.size());
}
void testBasic(bool async = false)
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2008-05-09 17:58:50 UTC (rev 2032)
@@ -127,7 +127,7 @@
recover(store, registry);
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue.get());
- BOOST_REQUIRE_EQUAL(id, queue->getPersistenceId());
+ BOOST_CHECK_EQUAL(id, queue->getPersistenceId());
}
}
@@ -154,8 +154,8 @@
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
BOOST_REQUIRE(queue->getPolicy());
- BOOST_REQUIRE_EQUAL(policy.getMaxCount(), queue->getPolicy()->getMaxCount());
- BOOST_REQUIRE_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
+ BOOST_CHECK_EQUAL(policy.getMaxCount(), queue->getPolicy()->getMaxCount());
+ BOOST_CHECK_EQUAL(policy.getMaxSize(), queue->getPolicy()->getMaxSize());
}
}
@@ -219,24 +219,24 @@
recover(store, registry);
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
- BOOST_REQUIRE_EQUAL((u_int32_t) 1, queue->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
Message::shared_ptr msg = queue->dequeue().payload;
- BOOST_REQUIRE_EQUAL(exchange, msg->getExchangeName());
- BOOST_REQUIRE_EQUAL(routingKey, msg->getRoutingKey());
- BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
- BOOST_REQUIRE_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
+ BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
+ BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
+ BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+ BOOST_CHECK_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
BOOST_REQUIRE(Str16Value("xyz") == *msg->getProperties<MessageProperties>()->getApplicationHeaders().get("abc"));
- BOOST_REQUIRE_EQUAL((u_int64_t) 14, msg->contentSize());
+ BOOST_CHECK_EQUAL((u_int64_t) 14, msg->contentSize());
DummyHandler handler;
QueuedMessage qm(queue.get(),msg,0);
MessageDelivery::deliver(qm, handler, 0, MessageDelivery::getMessageDeliveryToken("ignore", 0, 0), 100);
- BOOST_REQUIRE_EQUAL((size_t) 3, handler.frames.size());
+ BOOST_CHECK_EQUAL((size_t) 3, handler.frames.size());
AMQContentBody* contentBody(dynamic_cast<AMQContentBody*>(handler.frames[2].getBody()));
BOOST_REQUIRE(contentBody);
- BOOST_REQUIRE_EQUAL(data1.size() + data2.size(), contentBody->getData().size());
- BOOST_REQUIRE_EQUAL(data1 + data2, contentBody->getData());
+ BOOST_CHECK_EQUAL(data1.size() + data2.size(), contentBody->getData().size());
+ BOOST_CHECK_EQUAL(data1 + data2, contentBody->getData());
}
}
@@ -271,7 +271,7 @@
recover(store, registry);
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, queue->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, queue->getMessageCount());
}
}
@@ -321,7 +321,7 @@
BOOST_REQUIRE(contentBody);
loaded += contentBody->getData();
}
- BOOST_REQUIRE_EQUAL(data1 + data2, loaded);
+ BOOST_CHECK_EQUAL(data1 + data2, loaded);
}//db will be closed
{
@@ -339,18 +339,18 @@
//get message instance from queue
Queue::shared_ptr queue = registry.find(name);
BOOST_REQUIRE(queue);
- BOOST_REQUIRE_EQUAL((u_int32_t) 1, queue->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 1, queue->getMessageCount());
Message::shared_ptr msg = queue->dequeue().payload;
//check headers
- BOOST_REQUIRE_EQUAL(exchange, msg->getExchangeName());
- BOOST_REQUIRE_EQUAL(routingKey, msg->getRoutingKey());
- BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
- BOOST_REQUIRE_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
+ BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
+ BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
+ BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+ BOOST_CHECK_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
BOOST_REQUIRE(Str16Value("xyz") == *msg->getProperties<MessageProperties>()->getApplicationHeaders().get("abc"));
- BOOST_REQUIRE_EQUAL((u_int64_t) (data1.size() + data2.size()), msg->getFrames().getHeaders()->getContentLength());
+ BOOST_CHECK_EQUAL((u_int64_t) (data1.size() + data2.size()), msg->getFrames().getHeaders()->getContentLength());
- BOOST_REQUIRE_EQUAL((u_int64_t) 0, msg->contentSize());//ensure it is being lazily loaded
+ BOOST_CHECK_EQUAL((u_int64_t) 0, msg->contentSize());//ensure it is being lazily loaded
//load lazily
DummyHandler handler;
@@ -364,7 +364,7 @@
BOOST_REQUIRE(contentBody);
loaded += contentBody->getData();
}
- BOOST_REQUIRE_EQUAL(data1 + data2, loaded);
+ BOOST_CHECK_EQUAL(data1 + data2, loaded);
//dequeue
queue->dequeue(0, msg);
@@ -415,7 +415,7 @@
string loaded;
store.loadContent(queue, cpmsg, loaded, 0, data.length());
- BOOST_REQUIRE_EQUAL(data, loaded);
+ BOOST_CHECK_EQUAL(data, loaded);
store.dequeue(0, pmsg, queue);
store.destroy(queue);
@@ -446,10 +446,10 @@
recover(store, registry);
Exchange::shared_ptr exchange = registry.get(name);
- BOOST_REQUIRE_EQUAL(id, exchange->getPersistenceId());
- BOOST_REQUIRE_EQUAL(type, exchange->getType());
+ BOOST_CHECK_EQUAL(id, exchange->getPersistenceId());
+ BOOST_CHECK_EQUAL(type, exchange->getType());
BOOST_REQUIRE(exchange->isDurable());
- BOOST_REQUIRE_EQUAL(*args.get("a"), *exchange->getArgs().get("a"));
+ BOOST_CHECK_EQUAL(*args.get("a"), *exchange->getArgs().get("a"));
store.destroy(*exchange);
}
{
@@ -463,7 +463,7 @@
Exchange::shared_ptr exchange = registry.get(name);
BOOST_FAIL("Expected exchange not to be found");
} catch (const SessionException& e) {
- BOOST_REQUIRE_EQUAL((framing::ReplyCode) 404, e.code);
+ BOOST_CHECK_EQUAL((framing::ReplyCode) 404, e.code);
}
}
}
@@ -575,7 +575,7 @@
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
BOOST_FAIL("Expected exchange not to be found");
} catch (const SessionException& e) {
- BOOST_REQUIRE_EQUAL((framing::ReplyCode) 404, e.code);
+ BOOST_CHECK_EQUAL((framing::ReplyCode) 404, e.code);
}
Queue::shared_ptr queue = queues.find(queueName2);
store.destroy(*queue);
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2008-05-09 17:58:50 UTC (rev 2032)
@@ -109,11 +109,11 @@
y = queueA;
}
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, x->getMessageCount());
- BOOST_REQUIRE_EQUAL((u_int32_t) 1, y->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, x->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 1, y->getMessageCount());
Message::shared_ptr msg = y->dequeue().payload;
BOOST_REQUIRE(msg);
- BOOST_REQUIRE_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
+ BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
}
void swap(bool commit, bool async)
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2008-05-09 17:58:50 UTC (rev 2032)
@@ -147,8 +147,8 @@
restart();
//check that the message is not available from either queue
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, queueA->getMessageCount());
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, queueB->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, queueA->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, queueB->getMessageCount());
//commit/abort the txn - through the dtx manager, not directly on the store
if (commit) {
@@ -273,21 +273,21 @@
y = queueA;
}
- BOOST_REQUIRE_EQUAL((u_int32_t) 0, x->getMessageCount());
- BOOST_REQUIRE_EQUAL((u_int32_t) 1, y->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 0, x->getMessageCount());
+ BOOST_CHECK_EQUAL((u_int32_t) 1, y->getMessageCount());
Message::shared_ptr msg = y->dequeue().payload;
BOOST_REQUIRE(msg);
- BOOST_REQUIRE_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
+ BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
}
void checkA(u_int32_t size, const string& msgid = "<none>")
{
BOOST_REQUIRE(queueA);
- BOOST_REQUIRE_EQUAL(size, queueA->getMessageCount());
+ BOOST_CHECK_EQUAL(size, queueA->getMessageCount());
if (size > 0) {
Message::shared_ptr msg = queueA->dequeue().payload;
BOOST_REQUIRE(msg);
- BOOST_REQUIRE_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
+ BOOST_CHECK_EQUAL(msgid, msg->getProperties<MessageProperties>()->getCorrelationId());
}
}
Modified: store/trunk/cpp/tests/jrnl/jtt/args.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/args.cpp 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/jrnl/jtt/args.cpp 2008-05-09 17:58:50 UTC (rev 2032)
@@ -34,7 +34,7 @@
{
args::args(std::string opt_title):
- _options_descr(opt_title, 100),
+ _options_descr(opt_title),
format_chk(false),
keep_jrnls(false),
lld_rd_num(10),
Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-05-09 16:14:57 UTC (rev 2031)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2008-05-09 17:58:50 UTC (rev 2032)
@@ -177,9 +177,9 @@
format = '=4sBBHQ'
- @staticmethod
def descriminate(args):
return CLASSES.get(args[1][-1], Hdr)
+ descriminate = staticmethod(descriminate)
def __init__(self, foffs, magic, ver, end, flags, rid):
self.foffs = foffs
17 years, 11 months
rhmessaging commits: r2031 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-09 12:14:57 -0400 (Fri, 09 May 2008)
New Revision: 2031
Modified:
mgmt/cumin/python/cumin/broker.strings
Log:
Check for negative values as well
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-05-09 16:12:32 UTC (rev 2030)
+++ mgmt/cumin/python/cumin/broker.strings 2008-05-09 16:14:57 UTC (rev 2031)
@@ -93,7 +93,7 @@
count = wooly.doc().elembyid("timer_count").set("" + secs);
ending = wooly.doc().elembyid("timer_word").set(secs == 1 ? "second" : "seconds");
- if (secs == 0) {
+ if (secs < 1) {
location.reload();
}
}
17 years, 11 months
rhmessaging commits: r2030 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-09 12:12:32 -0400 (Fri, 09 May 2008)
New Revision: 2030
Modified:
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/widgets.strings
mgmt/cumin/python/wooly/widgets.strings
Log:
A bunch of formatting fixes
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-05-09 15:13:34 UTC (rev 2029)
+++ mgmt/cumin/python/cumin/broker.strings 2008-05-09 16:12:32 UTC (rev 2030)
@@ -107,13 +107,15 @@
[BrokerDetailsTab.html]
<table class="CuminDetails">
<tr>
- <th>Properties</th>
- <th>Actions</th>
+ <td>
+ <h2>Properties</h2>
+ {properties}
+ </td>
+ <td>
+ <h2>Actions</h2>
+ {actions}
+ </td>
</tr>
- <tr>
- <td>{properties}</td>
- <td>{actions}</td>
- </tr>
</table>
[BrokerBrowser.css]
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2008-05-09 15:13:34 UTC (rev 2029)
+++ mgmt/cumin/python/cumin/widgets.strings 2008-05-09 16:12:32 UTC (rev 2030)
@@ -177,18 +177,25 @@
table.CuminDetails > tbody > tr > td {
width: 50%;
padding: 0.5em;
+ vertical-align: top;
}
+table.CuminDetails ul.ActionSet {
+ margin: 1em 0.5em;
+}
+
[CuminDetails.html]
<table class="CuminDetails">
<tr>
- <th>Properties</th>
- <th>Actions</th>
+ <td>
+ <h2>Properties</h2>
+ {properties}
+ </td>
+ <td>
+ <h2>Actions</h2>
+ {actions}
+ </td>
</tr>
- <tr>
- <td>{properties}</td>
- <td>{actions}</td>
- </tr>
</table>
[CuminSummary.css]
@@ -242,6 +249,21 @@
</div>
</div>
+[SummaryProperties.css]
+table.SummaryProperties th {
+ color: #444;
+ font-weight: normal;
+ padding: 0 0.5em 0 0;
+}
+
+[SummaryProperties.html]
+<table class="SummaryProperties">
+ <tbody>{items}</tbody>
+</table>
+
+[SummaryProperties.property_html]
+<tr><th>{title}</th><td>{value}</td></tr>
+
[StateSwitch.html]
<ul class="radiotabs">
{items}
Modified: mgmt/cumin/python/wooly/widgets.strings
===================================================================
--- mgmt/cumin/python/wooly/widgets.strings 2008-05-09 15:13:34 UTC (rev 2029)
+++ mgmt/cumin/python/wooly/widgets.strings 2008-05-09 16:12:32 UTC (rev 2030)
@@ -132,19 +132,42 @@
<li><a {class_attr} href="{href}">{content}</a></li>
[PropertySet.css]
+table.PropertySet {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1em 0.5em;
+}
+
+table.PropertySet tr {
+ border-top: 1px dotted #ccc;
+}
+
table.PropertySet th, table.PropertySet td {
- padding: 0 0.5em 0 0;
+ padding: 0.35em 0.5em;
+ font-weight: normal;
vertical-align: top;
}
table.PropertySet th {
color: #444;
- font-weight: normal;
text-align: left;
}
+table.PropertySet thead th {
+ font-style: italic;
+ font-size: 0.9em;
+}
+
[PropertySet.html]
-<table class="PropertySet">{items}</table>
+<table class="PropertySet">
+ <thead>
+ <tr>
+ <th style="width: 50%;">Name</th>
+ <th style="width: 50%;">Value</th>
+ </tr>
+ </thead>
+ <tbody>{items}</tbody>
+</table>
[PropertySet.property_html]
<tr><th>{title}</th><td>{value}</td></tr>
17 years, 11 months
rhmessaging commits: r2029 - mgmt/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-09 11:13:34 -0400 (Fri, 09 May 2008)
New Revision: 2029
Modified:
mgmt/cumin/bin/cumin-admin
Log:
Add internal permission check to cumin-admin
Modified: mgmt/cumin/bin/cumin-admin
===================================================================
--- mgmt/cumin/bin/cumin-admin 2008-05-09 14:43:35 UTC (rev 2028)
+++ mgmt/cumin/bin/cumin-admin 2008-05-09 15:13:34 UTC (rev 2029)
@@ -35,7 +35,21 @@
return args
+def check_permission():
+ curr_uid = os.getuid()
+ file_uid = os.stat(__file__).st_uid
+
+ if curr_uid == 0 or curr_uid == file_uid:
+ pass
+ else:
+ print "You don't have sufficient privileges"
+ sys.exit(1)
+
def main():
+ if "-h" in sys.argv or "--help" in sys.argv:
+ print_usage(config)
+ sys.exit(0)
+
config = CuminConfig()
config.add_param("force", bool, False, "Don't complain and just do it")
@@ -43,11 +57,6 @@
config.init()
- if "-h" in sys.argv or "--help" in sys.argv:
- print_usage(config)
- sys.exit(0)
-
-
if config.debug:
config.prt()
@@ -58,6 +67,8 @@
print_usage(config)
sys.exit(1)
+ check_permission()
+
command = args[0]
database = MintDatabase(config.data)
17 years, 11 months