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/06/15 17:31:15 UTC

qpid-dispatch git commit: DISPATCH-363 - Removed all annotation sections in doc except sslProfile. Removed sslProfile attributes from connector and listener. All changes only in qdrouter.json man doc page

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master c66ba93cc -> 47396a924


DISPATCH-363 - Removed all annotation sections in doc except sslProfile. Removed sslProfile attributes from connector and listener. All changes only in qdrouter.json man doc page


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

Branch: refs/heads/master
Commit: 47396a9249b66c7e8708b61a238e8df090f8c918
Parents: c66ba93
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Wed Jun 15 13:30:45 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Wed Jun 15 13:30:45 2016 -0400

----------------------------------------------------------------------
 doc/man/qdrouterd_conf_man.py | 88 ++++++++++++++++++++++++++------------
 1 file changed, 60 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/47396a92/doc/man/qdrouterd_conf_man.py
----------------------------------------------------------------------
diff --git a/doc/man/qdrouterd_conf_man.py b/doc/man/qdrouterd_conf_man.py
index fadb574..92e2835 100644
--- a/doc/man/qdrouterd_conf_man.py
+++ b/doc/man/qdrouterd_conf_man.py
@@ -1,21 +1,21 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License
-##
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License
+#
 
 """
 Generate the qdrouterd.conf.md man page from the qdrouterd management schema.
@@ -24,17 +24,28 @@ Generate the qdrouterd.conf.md man page from the qdrouterd management schema.
 import sys
 from qpid_dispatch_internal.management.qdrouter import QdSchema
 from qpid_dispatch_internal.management.schema_doc import SchemaWriter
+from qpid_dispatch_internal.management.schema import AttributeType
+
+CONNECTOR = 'org.apache.qpid.dispatch.connector'
+LISTENER = 'org.apache.qpid.dispatch.listener'
 
 class ManPageWriter(SchemaWriter):
 
     def __init__(self):
         super(ManPageWriter, self).__init__(sys.stdout, QdSchema())
+        self.sslProfileAttributes = []
 
     def attribute_type(self, attr, holder):
         # Don't show read-only attributes
-        if not attr.create and not attr.update: return
+        if not attr.create and not attr.update:
+            return
         super(ManPageWriter, self).attribute_type(attr, holder, show_create=False, show_update=False)
 
+    def is_entity_connector_or_listener(self, entity):
+        if CONNECTOR == entity.name or LISTENER == entity.name:
+            return True
+        return False
+
     def man_page(self):
         self.writeln(r"""
 :orphan:
@@ -90,25 +101,46 @@ attribute of 'sslProfile' sections.
     }
 """)
 
-        with self.section("Annotation Sections"):
+        with self.section("Configuration Sections"):
             for annotation in self.schema.annotations.itervalues():
+                # We are skipping connectionRole and addrPort annotations from the doc because it is
+                # confusing to the user
+                if "addrPort" in annotation.name or "connectionRole" in annotation.name:
+                        continue
                 used_by = [e.short_name for e in self.schema.entity_types.itervalues()
                            if annotation in e.annotations]
                 with self.section(annotation.short_name):
-                    if annotation.description: self.para(annotation.description)
-                    if used_by: self.para('Used by: **%s**.'%('**, **'.join(used_by)))
+                    if annotation.description:
+                        self.para(annotation.description)
+                    if used_by:
+                        self.para('Used by: **%s**.'%('**, **'.join(used_by)))
+
+                    if "sslProfile" in annotation.name:
+                        # sslProfileName is an internal attribute and should not show in the doc
+                        del annotation.attributes[u'sslProfileName']
+
+                        for attribute in annotation.attributes.keys():
+                            self.sslProfileAttributes.append(attribute)
+
+                        name_attr = AttributeType("name", type="string", defined_in=annotation,
+                                                  create=True, update=True, description="name of the sslProfile ")
+                        annotation.attributes[u'name'] = name_attr
+
                     self.attribute_types(annotation)
 
-        with self.section("Configuration Sections"):
             config = self.schema.entity_type("configurationEntity")
             for entity_type in self.schema.entity_types.itervalues():
+                if self.is_entity_connector_or_listener(entity_type):
+                    for sslProfileAttribute in self.sslProfileAttributes:
+                        del entity_type.attributes[sslProfileAttribute]
+                    ssl_profile_attr = AttributeType("sslProfile", type="string", defined_in=entity_type,
+                                                     create=True, update=True, description="name of the sslProfile ")
+                    entity_type.attributes[u'sslProfile'] = ssl_profile_attr
+
                 if config in entity_type.all_bases:
                     with self.section(entity_type.short_name):
-                        if entity_type.description: self.para(entity_type.description)
-                        if entity_type.annotations:
-                            self.para('Annotations: **%s**.'%('**, **'.join(
-                                [a.short_name for a in entity_type.annotations])))
-                            for a in entity_type.annotations: self.attribute_types(a)
+                        if entity_type.description:
+                            self.para(entity_type.description)
                         self.attribute_types(entity_type)
 
         self.writeln("""


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