You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2015/10/22 22:56:48 UTC

qpid-dispatch git commit: DISPATCH-183 - Added a new property called 'hidden' which is used in the __str__() function to determine if the attribute can be shown

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 2991015c7 -> e5135fc8f


DISPATCH-183 - Added a new property called 'hidden' which is used in the __str__() function to determine if the attribute can be shown


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

Branch: refs/heads/master
Commit: e5135fc8f889cb549de10334fe1fc9911b85d445
Parents: 2991015
Author: ganeshmurthy <gm...@redhat.com>
Authored: Thu Oct 22 16:49:47 2015 -0400
Committer: ganeshmurthy <gm...@redhat.com>
Committed: Thu Oct 22 16:49:47 2015 -0400

----------------------------------------------------------------------
 python/qpid_dispatch/management/qdrouter.json      | 5 +++--
 python/qpid_dispatch_internal/management/agent.py  | 6 +++++-
 python/qpid_dispatch_internal/management/schema.py | 5 ++++-
 3 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5135fc8/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index ca6685e..d9e6343 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -640,7 +640,7 @@
         },
 
         "connector": {
-            "description": "Establishes an outgoing connections from the router.",
+            "description": "Establishes an outgoing connection from the router.",
             "extends": "configurationEntity",
             "operations": ["CREATE"],
             "annotations": [
@@ -689,7 +689,8 @@
                     "type": "string",
                     "required": false,
                     "description": "The password that the connector is using to connect to a peer.",
-                    "create": true
+                    "create": true,
+                    "hidden": true
                 }                                
             }
         },

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5135fc8/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 d1f9a0a..1436024 100644
--- a/python/qpid_dispatch_internal/management/agent.py
+++ b/python/qpid_dispatch_internal/management/agent.py
@@ -136,7 +136,6 @@ class PythonImplementation(Implementation):
         self.refresh_entity = impl.refresh_entity
 
 
-
 class EntityAdapter(SchemaEntity):
     """
     Base class for agent entities with operations as well as attributes.
@@ -219,6 +218,11 @@ class EntityAdapter(SchemaEntity):
         """Subclasses implement delete logic here"""
         pass
 
+    def __str__(self):
+        keys = sorted(self.attributes.keys())
+        # If the attribute is hidden the attribute value will show up as stars ('*******').
+        return "Entity(%s)" % ", ".join("%s=%s" % (k, '*******' if self.entity_type.attribute(k).hidden else self.attributes[k]) for k in keys)
+
 
 class ContainerEntity(EntityAdapter):
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5135fc8/python/qpid_dispatch_internal/management/schema.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/management/schema.py b/python/qpid_dispatch_internal/management/schema.py
index 8f7e961..5ea96de 100644
--- a/python/qpid_dispatch_internal/management/schema.py
+++ b/python/qpid_dispatch_internal/management/schema.py
@@ -206,7 +206,7 @@ class AttributeType(object):
     @ivar graph: If true the attribute could be graphed by a console.
     """
 
-    def __init__(self, name, type=None, defined_in=None, default=None, required=False, unique=False,
+    def __init__(self, name, type=None, defined_in=None, default=None, required=False, unique=False, hidden=False,
                  value=None, description="", create=False, update=False, graph=False):
         """
         See L{AttributeType} instance variables.
@@ -216,6 +216,7 @@ class AttributeType(object):
             self.defined_in = defined_in
             self.atype = get_type(type)
             self.required = required
+            self.hidden = hidden
             self.default = default
             self.value = value
             self.unique = unique
@@ -514,9 +515,11 @@ class Schema(object):
         else:
             self.prefix = self.prefixdot = ""
         self.description = description
+
         def parsedefs(cls, defs):
             return OrderedDict((self.long_name(k), cls(k, self, **v))
                                for k, v in (defs or {}).iteritems())
+
         self.annotations = parsedefs(Annotation, annotations)
         self.entity_types = parsedefs(EntityType, entityTypes)
         self.all_attributes = set()


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