On 11/30/2015 12:15 PM, Jan Cholasta wrote:
On 27.11.2015 15:57, Petr Vobornik wrote:
On 11/27/2015 02:50 PM, Martin Babinsky wrote:
On 11/20/2015 03:56 PM, Petr Vobornik wrote:




ACK

Pushed to master: c688954c27c219cb18aff968fc1f510afff93981

As we discussed offline, the server plugin should use topologysuffix
name instead of the actual suffix DN for iparepltopomanagedsuffix. The
attached patch fixes that.


Also the correct plural form of "suffix" is "suffixes", not "suffices"
(<https://en.wiktionary.org/wiki/suffix#Noun>), I have fixed that in an
additional patch.


Wrt 519 - we may want to fix it on all places. See the attached wip patch (coincidentally made on Friday).

--
Petr Vobornik
From 747f9385b935ee5838ef68bc4c8171188fba5e25 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Fri, 27 Nov 2015 16:16:34 +0100
Subject: [PATCH] change suffices to suffixes

---
 install/tools/ipa-replica-manage         | 24 ++++++++++-----------
 install/ui/src/freeipa/topology.js       | 36 ++++++++++++++++----------------
 install/ui/src/freeipa/topology_graph.js | 18 ++++++++--------
 ipalib/plugins/topology.py               |  8 +++----
 4 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index ebbdf5c3301675d39d957f54d954a440ad5cbbc2..085aa29b7904958ced5281a2946a2d318ac371f6 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -571,15 +571,15 @@ def check_last_link(delrepl, realm, dirman_passwd, force):
         return None
 
 
-def map_masters_to_suffices(masters, suffices):
+def map_masters_to_suffixes(masters, suffixes):
     masters_to_suffix = {}
     suffix_name_to_root = {
-        s['iparepltopoconfroot'][0]: s['cn'][0] for s in suffices
+        s['iparepltopoconfroot'][0]: s['cn'][0] for s in suffixes
     }
 
     for master in masters:
-        managed_suffices = master['iparepltopomanagedsuffix']
-        for suffix in managed_suffices:
+        managed_suffixes = master['iparepltopomanagedsuffix']
+        for suffix in managed_suffixes:
             suffix_name = suffix_name_to_root[suffix]
             try:
                 masters_to_suffix[suffix_name].append(master)
@@ -598,15 +598,15 @@ def check_last_link_managed(api, hostname, masters, force):
     """
     Check if 'hostname' is safe to delete.
 
-    :returns: a dictionary of topology errors across all suffices in the form
+    :returns: a dictionary of topology errors across all suffixes in the form
               {<suffix name>: (<original errors>,
               <errors after removing the node>)}
     """
-    suffices = api.Command.topologysuffix_find(u'')['result']
-    suffix_to_masters = map_masters_to_suffices(masters, suffices)
+    suffixes = api.Command.topologysuffix_find(u'')['result']
+    suffix_to_masters = map_masters_to_suffixes(masters, suffixes)
     topo_errors_by_suffix = {}
 
-    for suffix in suffices:
+    for suffix in suffixes:
         suffix_name = suffix['cn'][0]
         suffix_members = suffix_to_masters[suffix_name]
         print("Checking connectivity in topology suffix '{0}'".format(
@@ -776,7 +776,7 @@ def del_master_managed(realm, hostname, options):
     # 2. Get all masters
     masters = api.Command.server_find('', sizelimit=0)['result']
 
-    # 3. Check topology connectivity in all suffices
+    # 3. Check topology connectivity in all suffixes
     topo_errors = check_last_link_managed(
         api, hostname, masters, options.force)
 
@@ -871,10 +871,10 @@ def check_deleted_segments(hostname, masters, topo_errors, starting_host):
             hostname))
         return
 
-    suffices = api.Command.topologysuffix_find('', sizelimit=0)['result']
-    suffix_to_masters = map_masters_to_suffices(masters, suffices)
+    suffixes = api.Command.topologysuffix_find('', sizelimit=0)['result']
+    suffix_to_masters = map_masters_to_suffixes(masters, suffixes)
 
-    for suffix in suffices:
+    for suffix in suffixes:
         suffix_name = suffix['cn'][0]
         suffix_member_cns = [
             m['cn'][0] for m in suffix_to_masters[suffix_name]
diff --git a/install/ui/src/freeipa/topology.js b/install/ui/src/freeipa/topology.js
index 8dfa02a004235251a1ccd929896618a7307b1871..4c77f1b1b2660cdb78ffe6c5299852d7b1d316fa 100644
--- a/install/ui/src/freeipa/topology.js
+++ b/install/ui/src/freeipa/topology.js
@@ -636,7 +636,7 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
             }
         }).execute();
         when(s_promise, lang.hitch(this, function(results) {
-            // suffices load success
+            // suffixes load success
             var servers = results.data.result.result;
             deferred.resolve(servers);
         }), function(results) {
@@ -648,10 +648,10 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
         return deferred.promise;
     },
 
-    _get_suffices: function() {
+    _get_suffixes: function() {
         var deferred = new Deferred();
 
-        function get_suffices() {
+        function get_suffixes() {
             return rpc.command({
                 entity: 'topologysuffix',
                 method: 'find',
@@ -672,23 +672,23 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
             }).execute();
         }
 
-        var suff_promise = get_suffices();
+        var suff_promise = get_suffixes();
 
         when(suff_promise, lang.hitch(this, function(results) {
-            // suffices load success
-            var suffices = results.data.result.result;
+            // suffixes load success
+            var suffixes = results.data.result.result;
             var segment_promises = [];
-            for (var i=0,l=suffices.length; i<l; i++) {
-                var suffix = suffices[i];
+            for (var i=0,l=suffixes.length; i<l; i++) {
+                var suffix = suffixes[i];
                 var promise = get_segments(suffix['cn'][0]);
                 segment_promises.push(promise);
             }
             all(segment_promises).then(lang.hitch(this, function(results) {
                 // segments load success
                 for (var j=0,l=results.length; j<l; j++) {
-                    suffices[j].segments = results[j].data.result.result;
+                    suffixes[j].segments = results[j].data.result.result;
                 }
-                deferred.resolve(suffices);
+                deferred.resolve(suffixes);
             }), lang.hitch(this, function(results) {
                 // segments load failed
                 deferred.reject({
@@ -699,7 +699,7 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
         }), lang.hitch(this, function(results) {
             // suffix load failed
             deferred.reject({
-                message: 'unable to load suffices',
+                message: 'unable to load suffixes',
                 results: results
             });
         }));
@@ -707,7 +707,7 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
         return deferred.promise;
     },
 
-    _transform_data: function(servers, suffices) {
+    _transform_data: function(servers, suffixes) {
 
         var i,l;
         var nodes = [];
@@ -736,8 +736,8 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
             nodes.push(node);
         }
 
-        for (i=0,l=suffices.length; i<l; i++) {
-            var suffix = suffices[i];
+        for (i=0,l=suffixes.length; i<l; i++) {
+            var suffix = suffixes[i];
 
             for (var j=0,l2=suffix.segments.length; j<l2; j++) {
                 var segment = suffix.segments[j];
@@ -778,7 +778,7 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
         var data = {
             nodes: nodes,
             links: links,
-            suffices: suffices
+            suffixes: suffixes
         };
 
         return data;
@@ -788,7 +788,7 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
 
         var deferred = new Deferred();
 
-        var segments = this._get_suffices();
+        var segments = this._get_suffixes();
         var masters = this._get_servers();
 
         all([masters, segments]).then(lang.hitch(this, function(raw) {
@@ -811,13 +811,13 @@ topology.TopologyGraphWidget = declare([Stateful, Evented], {
                 this.graph = new topology_graph.TopoGraph({
                     nodes: data.nodes,
                     links: data.links,
-                    suffices: data.suffices
+                    suffixes: data.suffixes
                 });
                 this._bind_graph_events(this.graph);
                 this.graph.initialize(this.visualization_cnt_el);
 
             } else {
-                this.graph.update(data.nodes, data.links, data.suffices);
+                this.graph.update(data.nodes, data.links, data.suffixes);
             }
         }), function(error) {
             IPA.notify(error.message, 'error');
diff --git a/install/ui/src/freeipa/topology_graph.js b/install/ui/src/freeipa/topology_graph.js
index 94d0aa6bfc1a59e651abdb8fc5e2771c5b5c6c3f..23c7f6221a1e54770dcf08b3ebfc0b0a42810700 100644
--- a/install/ui/src/freeipa/topology_graph.js
+++ b/install/ui/src/freeipa/topology_graph.js
@@ -52,10 +52,10 @@ topology_graph.TopoGraph = declare([Evented], {
     links: [],
 
     /**
-     * List of suffices
+     * List of suffixes
      * @property {Array}
      */
-    suffices: [],
+    suffixes: [],
 
     /**
      * Initializes the graph
@@ -63,7 +63,7 @@ topology_graph.TopoGraph = declare([Evented], {
      */
     initialize: function(container) {
         this._create_svg(container);
-        this.update(this.nodes, this.links, this.suffices);
+        this.update(this.nodes, this.links, this.suffixes);
         return;
     },
 
@@ -71,9 +71,9 @@ topology_graph.TopoGraph = declare([Evented], {
      * Update the graph
      * @param  {Array} nodes    array of node objects
      * @param  {Array} links    array of link objects
-     * @param  {Array} suffices array of suffices
+     * @param  {Array} suffixes array of suffixes
      */
-    update: function(nodes, links, suffices) {
+    update: function(nodes, links, suffixes) {
         // delete all from svg
         this._svg.selectAll("*").remove();
         this._svg.attr('width', this.width)
@@ -81,7 +81,7 @@ topology_graph.TopoGraph = declare([Evented], {
 
         this.links = links;
         this.nodes = nodes;
-        this.suffices = suffices;
+        this.suffixes = suffixes;
 
         // load saved coordinates
         for (var i=0,l=nodes.length; i<l; i++) {
@@ -239,7 +239,7 @@ topology_graph.TopoGraph = declare([Evented], {
     },
 
     /**
-     * Defines link arrows and colors of suffices(links) and nodes
+     * Defines link arrows and colors of suffixes(links) and nodes
      */
     _define_shapes: function() {
 
@@ -251,9 +251,9 @@ topology_graph.TopoGraph = declare([Evented], {
         var x = 10;
         var y = 20;
 
-        for (var i=0,l=this.suffices.length; i<l; i++) {
+        for (var i=0,l=this.suffixes.length; i<l; i++) {
 
-            var suffix = this.suffices[i];
+            var suffix = this.suffixes[i];
             color = d3.rgb(this._colors(suffix.cn[0]));
 
             name = this._get_marker_name(suffix, false);
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index 2c43758c3136a546a50472cf97d79129d1d6c738..2c54bbc4dacd04ab95e55c82852428f6b0e4b1aa 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -328,11 +328,11 @@ class topologysuffix(LDAPObject):
     """
     container_dn = api.env.container_topology
     object_name = _('suffix')
-    object_name_plural = _('suffices')
+    object_name_plural = _('suffixes')
     object_class = ['iparepltopoconf']
     default_attributes = ['cn', 'ipaReplTopoConfRoot']
     search_display_attributes = ['cn', 'ipaReplTopoConfRoot']
-    label = _('Topology suffices')
+    label = _('Topology suffixes')
     label_singular = _('Topology suffix')
 
     takes_params = (
@@ -354,11 +354,11 @@ class topologysuffix(LDAPObject):
 
 @register()
 class topologysuffix_find(LDAPSearch):
-    __doc__ = _('Search for topology suffices.')
+    __doc__ = _('Search for topology suffixes.')
 
     msg_summary = ngettext(
         '%(count)d topology suffix matched',
-        '%(count)d topology suffices matched', 0
+        '%(count)d topology suffixes matched', 0
     )
 
 
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to