Re: [Freeipa-devel] [PATCH 0486, 0487] Update zanata config

2016-05-31 Thread Martin Basti



On 31.05.2016 13:46, Martin Basti wrote:



On 31.05.2016 13:04, Martin Babinsky wrote:

On 05/26/2016 04:52 PM, Martin Basti wrote:

https://fedorahosted.org/freeipa/ticket/5915

Patches attached




ACK.


Even better patches attached.






Wrong thread :D

The original patches were pushed

ipa-4-2:
* c404d6586d6fd76d04bcf656b811b04f29704a41 Set proper zanata project-version
* 776ef9ab63ee5bddc8ce0468570492b31180b70a Translations: remove 
deprecated locale configuration


ipa-4-3:
* 304bc038129229f6bd97e4415e6eec137f5fb3f8 Set proper zanata project-version
* 67633d42bcd78dc44d2bdfb18597942b49734eee Translations: remove 
deprecated locale configuration


master:
* 204a18986a1923f75bc75215d20dfa2eb9229729 Translations: remove 
deprecated locale configuration
-- 
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

Re: [Freeipa-devel] [PATCH 0486, 0487] Update zanata config

2016-05-31 Thread Martin Basti



On 31.05.2016 13:04, Martin Babinsky wrote:

On 05/26/2016 04:52 PM, Martin Basti wrote:

https://fedorahosted.org/freeipa/ticket/5915

Patches attached




ACK.


Even better patches attached.


From 1918df3017504354834c9175faf8d09108feb07a Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Fri, 13 May 2016 18:39:47 +0200
Subject: [PATCH 1/2] DNS Locations: prevent to remove used locations

User should be notified that location is used by IPA server(s) and
deletion should be aborted without --force option.

Referint plugin is configured to remove references of deleted locations.

https://fedorahosted.org/freeipa/ticket/2008
---
 API.txt|  3 ++-
 VERSION|  4 ++--
 install/updates/25-referint.update |  1 +
 ipalib/plugins/location.py | 27 ++-
 4 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/API.txt b/API.txt
index 608f1083faf2b03214432c134f403c40ccdb6700..10a2d9f076391f1a9133cf0899dd07d81043b0a3 100644
--- a/API.txt
+++ b/API.txt
@@ -2772,9 +2772,10 @@ output: Entry('result')
 output: Output('summary', type=[, ])
 output: PrimaryKey('value')
 command: location_del
-args: 1,2,3
+args: 1,3,3
 arg: DNSNameParam('idnsname+', cli_name='name')
 option: Flag('continue', autofill=True, cli_name='continue', default=False)
+option: Flag('force', autofill=True, default=False)
 option: Str('version?')
 output: Output('result', type=[])
 output: Output('summary', type=[, ])
diff --git a/VERSION b/VERSION
index 93ea86438d56f6206b28decbf95d2e7ccd57f8ed..90b240383a95bdc1783de99f416df1551641bfba 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=2010061412
 #  #
 
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=172
-# Last change: mbasti - location-show: list servers in the location
+IPA_API_VERSION_MINOR=173
+# Last change: mbasti - server-del: prevent to remove used locations
diff --git a/install/updates/25-referint.update b/install/updates/25-referint.update
index 3f78ee9755823fb3d5838d3069f4506c57a69d05..b887ede9c98f100709d24aae26b75d501f581016 100644
--- a/install/updates/25-referint.update
+++ b/install/updates/25-referint.update
@@ -19,3 +19,4 @@ add: referint-membership-attr: ipaassignedidview
 add: referint-membership-attr: ipaallowedtarget
 add: referint-membership-attr: ipamemberca
 add: referint-membership-attr: ipamembercertprofile
+add: referint-membership-attr: ipalocation
diff --git a/ipalib/plugins/location.py b/ipalib/plugins/location.py
index 6d876d51204f9957a091c12d89414fead0fc95c6..c38ff580964f314675dc0743a52dca27638a1f06 100644
--- a/ipalib/plugins/location.py
+++ b/ipalib/plugins/location.py
@@ -9,8 +9,10 @@ from ipalib import (
 ngettext,
 api,
 Str,
-DNSNameParam
+DNSNameParam,
+Flag,
 )
+from ipalib.errors import DependentEntry
 from ipalib.plugable import Registry
 from ipalib.plugins.baseldap import (
 LDAPCreate,
@@ -134,6 +136,29 @@ class location_del(LDAPDelete):
 
 msg_summary = _('Deleted IPA location "%(value)s"')
 
+takes_options = LDAPDelete.takes_options + (
+Flag(
+'force',
+label=_('Force'),
+doc=_('force location removal'),
+),
+)
+
+def pre_callback(self, ldap, dn, *keys, **options):
+assert isinstance(dn, DN)
+if not options.get('force'):
+servers = self.api.Command.server_find(
+in_location=keys[-1])['result']
+location_members = u', '.join(
+server['cn'][0] for server in servers)
+if location_members:
+raise DependentEntry(
+label=_('IPA Server(s)'),
+key=keys[-1],
+dependent=location_members
+)
+return dn
+
 
 @register()
 class location_mod(LDAPUpdate):
-- 
2.5.5

From bdd9280996de8d28dfb8b74fe07dd597eeb13bc5 Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Tue, 17 May 2016 13:08:59 +0200
Subject: [PATCH 2/2] DNS Locations: extend tests with server-* commands

https://fedorahosted.org/freeipa/ticket/2008
---
 ipatests/test_xmlrpc/test_location_plugin.py| 101 +-
 ipatests/test_xmlrpc/tracker/location_plugin.py |  29 +--
 ipatests/test_xmlrpc/tracker/server_plugin.py   | 107 
 3 files changed, 230 insertions(+), 7 deletions(-)
 create mode 100644 ipatests/test_xmlrpc/tracker/server_plugin.py

diff --git a/ipatests/test_xmlrpc/test_location_plugin.py b/ipatests/test_xmlrpc/test_location_plugin.py
index 1ca3eac7c72e0662034cb67039e1d0925bd1acca..a5d0797958b62e72714ac0f3e1e8c50dd5836d6b 100644
--- a/ipatests/test_xmlrpc/test_location_plugin.py
+++ b/ipatests/test_xmlrpc/test_location_plugin.py
@@ -5,12 +5,14 @@ from __future__ import absolute_import
 
 import pytest
 
-from ipalib 

Re: [Freeipa-devel] [PATCH 0486, 0487] Update zanata config

2016-05-31 Thread Martin Babinsky

On 05/26/2016 04:52 PM, Martin Basti wrote:

https://fedorahosted.org/freeipa/ticket/5915

Patches attached




ACK.

--
Martin^3 Babinsky

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


[Freeipa-devel] [PATCH 0486, 0487] Update zanata config

2016-05-26 Thread Martin Basti

https://fedorahosted.org/freeipa/ticket/5915

Patches attached

From f45f57256342dac4b4a5bbbef7241d60371195ca Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Thu, 26 May 2016 14:56:16 +0200
Subject: [PATCH] Set proper zanata project-version

https://fedorahosted.org/freeipa/ticket/5915
---
 zanata.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zanata.xml b/zanata.xml
index f954047360a9501df13bcf23bf4687757b987be7..736efff2575d9d2fa848c29ae91f5865f1ddda9e 100644
--- a/zanata.xml
+++ b/zanata.xml
@@ -2,7 +2,7 @@
 http://zanata.org/namespace/config/;>
   https://fedora.zanata.org/
   freeipa
-  master
+  ipa-4-2
   gettext
   .
   .
-- 
2.5.5

From 41ab3228c28fa85117d0f340557f6ef382b6c8bb Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Thu, 26 May 2016 15:41:50 +0200
Subject: [PATCH] Set proper zanata project-version

https://fedorahosted.org/freeipa/ticket/5915
---
 zanata.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zanata.xml b/zanata.xml
index f954047360a9501df13bcf23bf4687757b987be7..c0a2f91e504a434e66a37338193d2e9035b1f6de 100644
--- a/zanata.xml
+++ b/zanata.xml
@@ -2,7 +2,7 @@
 http://zanata.org/namespace/config/;>
   https://fedora.zanata.org/
   freeipa
-  master
+  ipa-4-3
   gettext
   .
   .
-- 
2.5.5

From 59a64881b539bd5354d8489bb584de50844b83e7 Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Thu, 26 May 2016 14:41:57 +0200
Subject: [PATCH] Translations: remove deprecated locale configuration

zanata.xml should not contain , because this tag is deprecated
and locales are handled/configured on the server side. Also locale
mappings are done on server side.

https://fedorahosted.org/freeipa/ticket/5915
---
 zanata.xml | 20 
 1 file changed, 20 deletions(-)

diff --git a/zanata.xml b/zanata.xml
index f954047360a9501df13bcf23bf4687757b987be7..d39a5936268313c1c5ecf002110d8e3c678f331b 100644
--- a/zanata.xml
+++ b/zanata.xml
@@ -7,25 +7,5 @@
   .
   .
 
-  
-bn-IN
-ca
-cs
-de
-es
-eu
-fr
-hi
-hu
-id
-ja
-kn
-nl
-pl
-ru
-tg
-uk
-zh-CN
-  
   
 
-- 
2.5.5

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