Mod of segment end will be disallowed in topology plugin.

Reasoning (by Ludwig):  if we want to properly allow mods to change
connectivity and endpoints, then we would need to check if the mod
disconnects the topology, delete existing agreements, check if the new
would be a duplicate and create new agmts. There could be some difficult
scenarios, like having
  A <--> B <--> C <--> D,
if you modify the segment B-C to A-D topology breaks and is then
reconnected.

part of: https://fedorahosted.org/freeipa/ticket/4302
--
Petr Vobornik
From 62576685d63c0295000d6982b479358fff7b50fc Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 10 Jun 2015 15:03:44 +0200
Subject: [PATCH] disallow mod of topology segment nodes

Mod of segment end will be disallowed in topology plugin.

Reasoning (by Ludwig):  if we want to properly allow mods to change
connectivity and endpoints, then we would need to check if the mod
disconnects the topology, delete existing agreements, check if the new
would be a duplicate and create new agmts. There could be some difficult
scenarios, like having
  A <--> B <--> C <--> D,
if you modify the segment B-C to A-D topology breaks and is then
reconnected.

part of: https://fedorahosted.org/freeipa/ticket/4302
---
 API.txt                    | 4 +---
 VERSION                    | 4 ++--
 ipalib/plugins/topology.py | 2 ++
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/API.txt b/API.txt
index 08abdc3494c5b4c037a168cf4fe952fb374862ff..5d219040a12d801d2cafbc52d05fe04f16bc4e5f 100644
--- a/API.txt
+++ b/API.txt
@@ -4614,15 +4614,13 @@ output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list
 output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
 output: Output('truncated', <type 'bool'>, None)
 command: topologysegment_mod
-args: 2,15,3
+args: 2,13,3
 arg: Str('topologysuffixcn', cli_name='topologysuffix', multivalue=False, primary_key=True, query=True, required=True)
 arg: Str('cn', attribute=True, cli_name='name', maxlength=255, multivalue=False, primary_key=True, query=True, required=True)
 option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
 option: Str('delattr*', cli_name='delattr', exclude='webui')
 option: StrEnum('iparepltoposegmentdirection', attribute=True, autofill=False, cli_name='direction', default=u'both', multivalue=False, required=False, values=(u'both', u'left-right', u'right-left'))
-option: Str('iparepltoposegmentleftnode', attribute=True, autofill=False, cli_name='leftnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', required=False)
-option: Str('iparepltoposegmentrightnode', attribute=True, autofill=False, cli_name='rightnode', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9.][a-zA-Z0-9.-]{0,252}[a-zA-Z0-9.$-]?$', required=False)
 option: StrEnum('nsds5replicaenabled', attribute=True, autofill=False, cli_name='enabled', multivalue=False, required=False, values=(u'on', u'off'))
 option: Str('nsds5replicastripattrs', attribute=True, autofill=False, cli_name='stripattrs', multivalue=False, required=False)
 option: Str('nsds5replicatedattributelist', attribute=True, autofill=False, cli_name='replattrs', multivalue=False, required=False)
diff --git a/VERSION b/VERSION
index 346af80582b78904a6f274a40897db65f170531d..e325c90cae1cbdc1f1e705ff9c078a4f5242eb14 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=128
-# Last change: pvoborni - toposegment direction restrictions
+IPA_API_VERSION_MINOR=129
+# Last change: pvoborni - disallow mod of topologysegment nodes
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index 6aa77c1f673da18e71fd9d5a7a7674ba5c446574..647c829689d3eba0a782d38d0d67b7179ec5e413 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -81,6 +81,7 @@ class topologysegment(LDAPObject):
             label=_('Left node'),
             normalizer=lambda value: value.lower(),
             doc=_('Left replication node - an IPA server'),
+            flags={'no_update'},
         ),
         Str(
             'iparepltoposegmentrightnode',
@@ -91,6 +92,7 @@ class topologysegment(LDAPObject):
             label=_('Right node'),
             normalizer=lambda value: value.lower(),
             doc=_('Right replication node - an IPA server'),
+            flags={'no_update'},
         ),
         StrEnum(
             'iparepltoposegmentdirection',
-- 
2.1.0

-- 
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