You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2016/05/18 15:43:18 UTC

qpid-dispatch git commit: DISPATCH-339 - Modified tools/qdstat to display proper router_id. Added warning log message if routerId is used

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 8e14e28a4 -> 0cc6b2ca6


DISPATCH-339 - Modified tools/qdstat to display proper router_id. Added warning log message if routerId is used


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/0cc6b2ca
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/0cc6b2ca
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/0cc6b2ca

Branch: refs/heads/master
Commit: 0cc6b2ca6701e24161781c01a33c92ab9ef16aa7
Parents: 8e14e28
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Wed May 18 11:39:50 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Wed May 18 11:41:33 2016 -0400

----------------------------------------------------------------------
 python/qpid_dispatch_internal/management/agent.py | 8 +++++++-
 tools/qdstat                                      | 7 +++++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0cc6b2ca/python/qpid_dispatch_internal/management/agent.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/management/agent.py b/python/qpid_dispatch_internal/management/agent.py
index 77e3416..99f3375 100644
--- a/python/qpid_dispatch_internal/management/agent.py
+++ b/python/qpid_dispatch_internal/management/agent.py
@@ -73,7 +73,7 @@ from cProfile import Profile
 from cStringIO import StringIO
 from ctypes import c_void_p, py_object, c_long
 from subprocess import Popen
-from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_DEBUG, LOG_ERROR, TREATMENT_ANYCAST_CLOSEST
+from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_WARNING, LOG_DEBUG, LOG_ERROR, TREATMENT_ANYCAST_CLOSEST
 from qpid_dispatch.management.error import ManagementError, OK, CREATED, NO_CONTENT, STATUS_TEXT, \
     BadRequestStatus, InternalServerErrorStatus, NotImplementedStatus, NotFoundStatus
 from qpid_dispatch.management.entity import camelcase
@@ -259,6 +259,12 @@ class RouterEntity(EntityAdapter):
     def _identifier(self): return self.attributes.get('id')
 
     def create(self):
+        try:
+            if self.routerId:
+                self._agent.log(LOG_WARNING, "routerId is deprecated, use id instead")
+        except:
+            pass
+
         self._qd.qd_dispatch_configure_router(self._dispatch, self)
 
     def __str__(self):

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0cc6b2ca/tools/qdstat
----------------------------------------------------------------------
diff --git a/tools/qdstat b/tools/qdstat
index a6ac878..0b52284 100755
--- a/tools/qdstat
+++ b/tools/qdstat
@@ -176,7 +176,9 @@ class BusManager(Node):
             return addr[1]
         return ''
 
-    def _identity_clean(self, identity):
+    def _identity_clean(self, identity, router_id=None):
+        if router_id:
+            return router_id
         if not identity:
             return "-"
         pos = identity.find('/')
@@ -200,9 +202,10 @@ class BusManager(Node):
         objects = self.query('org.apache.qpid.dispatch.router')
 
         router = objects[0]
+        print 'router ', router
         rows.append(('Mode',          router.mode))
         rows.append(('Area',          router.area))
-        rows.append(('Router Id',     self._identity_clean(router.identity)))
+        rows.append(('Router Id',     self._identity_clean(router.identity, router.routerId)))
         rows.append(('Address Count', router.addrCount))
         rows.append(('Link Count',    router.linkCount))
         rows.append(('Node Count',    router.nodeCount))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org