[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread mbasti-rh
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

mbasti-rh commented:
"""
Thank you for PY3 fix, it actually belongs to this ticket 
https://fedorahosted.org/freeipa/ticket/6473
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261611874
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread mbasti-rh
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

mbasti-rh commented:
"""
> > I was thinking about this a bit, and was wondering whether the 
> > platform-specific idiosyncracies of the version handling could be safely 
> > confined to the platform-specific code. I.E ipaplatform.base would define 
> > version comparisons via standard pkg_resources parser and fedora/redhat 
> > would override this with their platform-specific quirks.

> Somebody used a time machine and implemented your proposal already. 
> tasks.parse_ipa_version() is a generic version parsing function. On RPM 
> platforms it returns an object that uses librpm.
> 

Yeah, I did.


> IMHO it's ok to use tasks.parse_ipa_version() everywhere.

As Martin said, we have two versions: package released version and API version.

For released package version we need RPM/platform specific parser, but API 
version is just 2 numbers and standard python function can be used. It is the 
same accross platforms. 

API version is less important now, because we have versions of commads that 
scales better, and one day we may drop this overall API version completely. If 
you want to avoid importing platform then is fine to use standard python 
functions to compare API versions. Actually that rpmlib scares me.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261610708
-- 
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] [freeipa PR#255][synchronized] Adjustments for setup requirements

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/255
Author: tiran
 Title: #255: Adjustments for setup requirements
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/255/head:pr255
git checkout pr255
From 2b9c49f80d0162e503ea16b9a413786dd1c2cee5 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 17 Nov 2016 16:43:17 +0100
Subject: [PATCH] Adjustments for setup requirements

Fix some typos, missing or surplus dependencies. Remove setup
requirement on wheel since it triggers download. ipatests is now
installable. Tests need further changes to be runable.

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

Signed-off-by: Christian Heimes 
---
 ipaclient/setup.py   |  8 ++--
 ipalib/setup.py  |  4 +---
 ipaplatform/setup.py |  3 ---
 ipapython/setup.py   |  4 +---
 ipaserver/setup.py   |  3 ---
 ipasetup.py.in   |  9 +
 ipatests/setup.py| 17 -
 7 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/ipaclient/setup.py b/ipaclient/setup.py
index fc5609b..e3ec079 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -48,13 +48,9 @@
 "ipalib",
 "ipapython",
 "python-nss",
+"python-yubico",
+"pyusb",
 "qrcode",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
-extra_requires={
-"otptoken_yubikey": ["yubico", "usb"]
-}
 )
diff --git a/ipalib/setup.py b/ipalib/setup.py
index 98af7ab..94d78de 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -41,10 +41,8 @@
 "ipapython",
 "netaddr",
 "pyasn1",
+"pyasn1-modules",
 "python-nss",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipaplatform/setup.py b/ipaplatform/setup.py
index 97311de..98a9f08 100644
--- a/ipaplatform/setup.py
+++ b/ipaplatform/setup.py
@@ -46,7 +46,4 @@
 "python-nss",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipapython/setup.py b/ipapython/setup.py
index 087086e..772ecfd 100755
--- a/ipapython/setup.py
+++ b/ipapython/setup.py
@@ -54,11 +54,9 @@
 "requests",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 extras_require={
 ":python_version<'3'": ["enum34"],
+"certmonger": ["dbus-python"],
 },
 entry_points={
 'custodia.authorizers': [
diff --git a/ipaserver/setup.py b/ipaserver/setup.py
index 5c38843..2009042 100755
--- a/ipaserver/setup.py
+++ b/ipaserver/setup.py
@@ -66,7 +66,4 @@
 # "python-SSSDConfig",
 # "samba-python",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipasetup.py.in b/ipasetup.py.in
index 5330956..64db5dc 100644
--- a/ipasetup.py.in
+++ b/ipasetup.py.in
@@ -19,9 +19,9 @@ import sys
 
 
 PACKAGE_VERSION = {
-'cryptography': 'cryptography >= 0.9',
+'cryptography': 'cryptography >= 1.5',
 'dnspython': 'dnspython >= 1.11.1',
-'gssapi': 'gssapi > 1.1.2',
+'gssapi': 'gssapi >= 1.2.0',
 'ipaclient': 'ipaclient == @VERSION@',
 'ipalib': 'ipalib == @VERSION@',
 'ipaplatform': 'ipaplatform == @VERSION@',
@@ -29,10 +29,11 @@ PACKAGE_VERSION = {
 'ipaserver': 'ipaserver == @VERSION@',
 'kdcproxy': 'kdcproxy >= 0.3',
 'netifaces': 'netifaces >= 0.10.4',
-'python-nss': 'python-nss >= 0.16',
 'pyldap': 'pyldap >= 2.4.15',
+'pytest': 'pytest < 3.0',
+'python-nss': 'python-nss >= 0.16',
+'python-yubico': 'python-yubico >= 1.2.3',
 'qrcode': 'qrcode >= 5.0',
-# 'yubico': 'yubico >= 1.2.3',
 }
 
 
diff --git a/ipatests/setup.py b/ipatests/setup.py
index 26f0124..b57226d 100644
--- a/ipatests/setup.py
+++ b/ipatests/setup.py
@@ -59,24 +59,23 @@
 },
 install_requires=[
 "cryptography",
-"dbus-python",
 "dnspython",
-"dogtag-pki",
+"gssapi",
 "ipaclient",
 "ipalib",
 "ipaplatform",
 "ipapython",
-"ipaserver",
 "nose",
 "pyldap",
 "pytest",
-"python-gssapi",
+"pytest_multihost",
 "python-nss",
-"selenium",
 "six",
-"yaml",
-],
-setup_requires=[
-"wheel",
 ],
+extras_require={
+"integration": ["dbus-python", "pyyaml", "ipaserver"],
+"ipaserver": ["ipaserver"],
+"webui": ["selenium", "pyyaml", "ipaserver"],
+"xmlrpc": ["ipaserver"],
+}
 )
-- 
Manage your subscription for the Freeipa-devel mailing list:

[Freeipa-devel] [freeipa PR#254][synchronized] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/254
Author: tiran
 Title: #254: Replace LooseVersion with parse_ipa_version()
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/254/head:pr254
git checkout pr254
From e49896c316bae2a6ea4f3b37973a024fd024a0a8 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:24:09 +0100
Subject: [PATCH 1/3] Minor fixes for IPAVersion class

Py3: classes with __eq__ must provide __hash__ function or set __hash__
to None.
Comparison function like __eq__ must signal unsupported types by
returning NotImplemented. Python turns this in a proper TypeError.
Make the version member read-only and cache _bytes represention.

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index dbe005a..5d627be 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -83,20 +83,26 @@ def selinux_enabled():
 class IPAVersion(object):
 
 def __init__(self, version):
-self.version = version
+self._version = version
+self._bytes = version.encode('utf-8')
 
 @property
-def _bytes(self):
-return self.version.encode('utf-8')
+def version(self):
+return self._version
 
 def __eq__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) == 0
 
 def __lt__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) < 0
 
+def __hash__(self):
+return hash(self._version)
+
 
 class RedHatTaskNamespace(BaseTaskNamespace):
 

From dd47e974bb497c296ae505fbc320a95e3221c95e Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:45:13 +0100
Subject: [PATCH 2/3] Break ipalib.x509 import cycle

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index 5d627be..74ca5f1 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -44,8 +44,6 @@
 from ipapython import ipautil
 import ipapython.errors
 
-from ipalib import x509 # FIXME: do not import from ipalib
-
 from ipaplatform.constants import constants
 from ipaplatform.paths import paths
 from ipaplatform.redhat.authconfig import RedHatAuthConfig
@@ -220,6 +218,9 @@ def reload_systemwide_ca_store(self):
 return True
 
 def insert_ca_certs_into_systemwide_ca_store(self, ca_certs):
+# break import cycle
+from ipalib import x509
+
 new_cacert_path = paths.SYSTEMWIDE_IPA_CA_CRT
 
 if os.path.exists(new_cacert_path):

From 32e4aba8a7db2884dadce3acc7096bf808184427 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 09:26:18 +0100
Subject: [PATCH 3/3] Replace LooseVersion with tasks.parse_ipa_version

pylint is having a hard time with distutils.version in tox's virtual
envs. virtualenv uses some tricks to provide a virtual distutils
package, pylint can't cope with.

https://github.com/PyCQA/pylint/issues/73 suggests to use pkg_resources
instead. parse_version() can't handle some RPM-specific versions
correctly. Let's use our own version parser everywhere.

Signed-off-by: Christian Heimes 
---
 ipaclient/remote_plugins/compat.py | 13 ++---
 ipalib/capabilities.py |  6 +++---
 ipalib/frontend.py |  8 +++-
 ipalib/plugable.py |  7 +++
 ipaserver/install/krbinstance.py   |  6 +++---
 ipaserver/install/server/replicainstall.py |  9 -
 6 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/ipaclient/remote_plugins/compat.py b/ipaclient/remote_plugins/compat.py
index 984eecd..b40bafb 100644
--- a/ipaclient/remote_plugins/compat.py
+++ b/ipaclient/remote_plugins/compat.py
@@ -2,7 +2,6 @@
 # Copyright (C) 2016  FreeIPA Contributors see COPYING for license
 #
 
-from distutils.version import LooseVersion
 import importlib
 import os
 import re
@@ -12,6 +11,7 @@
 
 from ipaclient.frontend import ClientCommand, ClientMethod
 from ipalib.frontend import Object
+from ipaplatform.tasks import tasks
 
 if six.PY3:
 unicode = str
@@ -58,7 +58,7 @@ def get_package(server_info, client):
 server_info['version'] = server_version
 server_info.update_validity()
 
-server_version = LooseVersion(server_version)
+server_version = 

[Freeipa-devel] [freeipa PR#182][synchronized] Use env var IPA_CONFDIR to get confdir for 'cli' context

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/182
Author: tiran
 Title: #182: Use env var IPA_CONFDIR to get confdir for 'cli' context
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/182/head:pr182
git checkout pr182
From f47356a8a14cfec8454d52fff71a21e4d8ad2ff3 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Mon, 24 Oct 2016 10:35:41 +0200
Subject: [PATCH] Use env var IPA_CONFDIR to get confdir

The environment variable IPA_CONFDIR overrides the default confdir path.
The value of the environment variable must be an absolute path to an existing
directory. The new variable makes it much simpler to use the 'ipa'
command and ipalib with a local configuration directory.

Some contexts like server, installer and upgrades do not support the env
var.

Signed-off-by: Christian Heimes 
---
 client/man/ipa.1  |  4 
 install/tools/ipa-httpd-kdcproxy  |  2 +-
 install/tools/ipa-replica-conncheck   |  2 +-
 ipalib/config.py  | 18 +++-
 ipatests/test_ipalib/test_plugable.py | 40 +--
 ipatests/util.py  |  6 ++
 6 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/client/man/ipa.1 b/client/man/ipa.1
index cc5641b..f35f557 100644
--- a/client/man/ipa.1
+++ b/client/man/ipa.1
@@ -190,6 +190,10 @@ The ipa client will determine which server to connect to in this order:
 
 .TP
 If a kerberos error is raised by any of the requests then it will stop processing and display the error message.
+.SH "ENVIRONMENT VARIABLES"
+.TP
+\fBIPA_CONFDIR\fR
+Override path to confdir (default: \fB/etc/ipa\fR).
 .SH "FILES"
 .TP
 \fB/etc/ipa/default.conf\fR
diff --git a/install/tools/ipa-httpd-kdcproxy b/install/tools/ipa-httpd-kdcproxy
index 329565c..34cdd88 100755
--- a/install/tools/ipa-httpd-kdcproxy
+++ b/install/tools/ipa-httpd-kdcproxy
@@ -184,7 +184,7 @@ class KDCProxyConfig(object):
 def main(debug=DEBUG, time_limit=TIME_LIMIT):
 # initialize API without file logging
 if not api.isdone('bootstrap'):
-api.bootstrap(context='ipa-httpd-kdcproxy', log=None, debug=debug)
+api.bootstrap(context='server', log=None, debug=debug)
 standard_logging_setup(verbose=True, debug=debug)
 
 try:
diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck
index 4045e41..fbe2dd5 100755
--- a/install/tools/ipa-replica-conncheck
+++ b/install/tools/ipa-replica-conncheck
@@ -478,7 +478,7 @@ def main():
 else:
 nss_dir = None
 
-api.bootstrap(context='client', xmlrpc_uri=xmlrpc_uri,
+api.bootstrap(context='installer', xmlrpc_uri=xmlrpc_uri,
   nss_dir=nss_db.secdir)
 api.finalize()
 try:
diff --git a/ipalib/config.py b/ipalib/config.py
index 1075d62..9eeb763 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -43,6 +43,7 @@
 from ipalib.base import check_name
 from ipalib.constants import CONFIG_SECTION
 from ipalib.constants import OVERRIDE_ERROR, SET_ERROR, DEL_ERROR
+from ipapython.admintool import ScriptError
 
 if six.PY3:
 unicode = str
@@ -200,6 +201,10 @@ class provides high-level methods for bootstraping a fresh `Env` instance
 
 __locked = False
 
+# Reserved contexts do not support IPA_CONFDIR env var
+_reserved_contexts = {'backup', 'cli_installer', 'installer', 'ipactl',
+  'renew', 'restore', 'server', 'updates'}
+
 def __init__(self, **initialize):
 object.__setattr__(self, '_Env__d', {})
 object.__setattr__(self, '_Env__done', set())
@@ -461,7 +466,18 @@ def _bootstrap(self, **overrides):
 
 # Set confdir:
 if 'confdir' not in self:
-if self.in_tree:
+ipa_confdir = os.environ.get('IPA_CONFDIR')
+if ipa_confdir is not None:
+if self.context in self._reserved_contexts:
+raise ScriptError(
+'IPA_CONFDIR env var is not allowed for context '
+'"{}".'.format(self.context))
+if not path.isabs(ipa_confdir) or not path.isdir(ipa_confdir):
+raise ScriptError(
+'IPA_CONFDIR env var must be an absolute path to an '
+'existing directory.')
+self.confdir = ipa_confdir
+elif self.in_tree:
 self.confdir = self.dot_ipa
 else:
 self.confdir = path.join('/', 'etc', 'ipa')
diff --git a/ipatests/test_ipalib/test_plugable.py b/ipatests/test_ipalib/test_plugable.py
index 1ee1102..ff22446 100644
--- a/ipatests/test_ipalib/test_plugable.py
+++ b/ipatests/test_ipalib/test_plugable.py
@@ -24,9 +24,13 @@
 # FIXME: Pylint errors
 # pylint: 

[Freeipa-devel] [freeipa PR#231][comment] Do not log DM password in ca/kra installation logs

2016-11-18 Thread stlaz
  URL: https://github.com/freeipa/freeipa/pull/231
Title: #231: Do not log DM password in ca/kra installation logs

stlaz commented:
"""
I must have misclicked "close" when viewing this PR on my phone. I believe we 
may rather add admin and DM passwords to the nolog_list at the point where the 
disclosed credentials file is created so that we avoid problems like this one 
in the future.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/231#issuecomment-261550522
-- 
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] [freeipa PR#231][reopened] Do not log DM password in ca/kra installation logs

2016-11-18 Thread stlaz
   URL: https://github.com/freeipa/freeipa/pull/231
Author: stlaz
 Title: #231: Do not log DM password in ca/kra installation logs
Action: reopened

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/231/head:pr231
git checkout pr231
-- 
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] [freeipa PR#258][opened] Break ipaplatform / ipalib import cycle of hell

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/258
Author: tiran
 Title: #258: Break ipaplatform / ipalib import cycle of hell
Action: opened

PR body:
"""
Here is an attempt to break the import cycle of hell between ipaplatform
and ipalib. All services now pass an ipalib.api object to
services.service(). RedHatServices.__init__() still needs to do a local
import because it initializes its wellknown service dict with service
instances.

Signed-off-by: Christian Heimes 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/258/head:pr258
git checkout pr258
From f89393b0ce3a9215cea3b17ce1247ab4e9435465 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 15:42:23 +0100
Subject: [PATCH] Break ipaplatform / ipalib import cycle of hell

Here is an attempt to break the import cycle of hell between ipaplatform
and ipalib. All services now pass an ipalib.api object to
services.service(). RedHatServices.__init__() still needs to do a local
import because it initializes its wellknown service dict with service
instances.

Signed-off-by: Christian Heimes 
---
 install/share/copy-schema-to-ca.py |  2 +-
 ipaclient/install/client.py|  8 
 ipaclient/ntpconf.py   | 11 ++-
 ipaplatform/base/services.py   | 22 +++---
 ipaplatform/fedora/services.py | 10 +-
 ipaplatform/redhat/services.py | 29 ++---
 ipaplatform/redhat/tasks.py|  4 ++--
 ipaplatform/rhel/services.py   | 10 +-
 ipaserver/install/adtrustinstance.py   |  6 +++---
 ipaserver/install/bindinstance.py  |  2 +-
 ipaserver/install/dns.py   |  2 +-
 ipaserver/install/httpinstance.py  |  4 ++--
 ipaserver/install/installutils.py  |  2 +-
 ipaserver/install/ipa_restore.py   |  2 +-
 ipaserver/install/opendnssecinstance.py|  2 +-
 ipaserver/install/server/replicainstall.py |  2 +-
 ipaserver/install/server/upgrade.py| 10 +-
 ipaserver/install/service.py   |  2 +-
 ipaserver/install/upgradeinstance.py   |  3 ++-
 ipaserver/plugins/dns.py   |  2 +-
 ipaserver/plugins/server.py|  2 +-
 21 files changed, 73 insertions(+), 64 deletions(-)

diff --git a/install/share/copy-schema-to-ca.py b/install/share/copy-schema-to-ca.py
index a6d09ec..eb2a306 100755
--- a/install/share/copy-schema-to-ca.py
+++ b/install/share/copy-schema-to-ca.py
@@ -104,7 +104,7 @@ def restart_pki_ds():
 """Restart the CA DS instance to pick up schema changes
 """
 root_logger.info('Restarting CA DS')
-services.service('dirsrv').restart(SERVERID)
+services.service('dirsrv', api).restart(SERVERID)
 
 
 def main():
diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
index b24a989..d18d8bb 100644
--- a/ipaclient/install/client.py
+++ b/ipaclient/install/client.py
@@ -2822,7 +2822,7 @@ def _install(options):
 root_logger.info("%s enabled", "SSSD" if options.sssd else "LDAP")
 
 if options.sssd:
-sssd = services.service('sssd')
+sssd = services.service('sssd', api)
 try:
 sssd.restart()
 except CalledProcessError:
@@ -3139,7 +3139,7 @@ def uninstall(options):
 
 root_logger.info(
 "IPA domain removed from current one, restarting SSSD service")
-sssd = services.service('sssd')
+sssd = services.service('sssd', api)
 try:
 sssd.restart()
 except CalledProcessError:
@@ -3153,7 +3153,7 @@ def uninstall(options):
 "Other domains than IPA domain found, IPA domain was removed "
 "from /etc/sssd/sssd.conf.")
 
-sssd = services.service('sssd')
+sssd = services.service('sssd', api)
 try:
 sssd.restart()
 except CalledProcessError:
@@ -3172,7 +3172,7 @@ def uninstall(options):
 "Redundant SSSD configuration file "
 "/etc/sssd/sssd.conf was moved to /etc/sssd/sssd.conf.deleted")
 
-sssd = services.service('sssd')
+sssd = services.service('sssd', api)
 try:
 sssd.stop()
 except CalledProcessError:
diff --git a/ipaclient/ntpconf.py b/ipaclient/ntpconf.py
index 9a7db65..c78f807 100644
--- a/ipaclient/ntpconf.py
+++ b/ipaclient/ntpconf.py
@@ -16,11 +16,12 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
 #
+import os
+import shutil
 
+from ipalib import api
 from ipapython import ipautil
 from ipapython.ipa_log_manager import root_logger
-import shutil
-import os
 from ipaplatform.tasks import tasks
 from ipaplatform import services
 from ipaplatform.paths import paths
@@ -189,7 

[Freeipa-devel] [freeipa PR#247][+pushed] Add 'ipa local-env' subcommand

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/247
Title: #247: Add 'ipa local-env' subcommand

Label: +pushed
-- 
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] [freeipa PR#247][comment] Add 'ipa local-env' subcommand

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/247
Title: #247: Add 'ipa local-env' subcommand

martbab commented:
"""
Fixed upstream
master:
https://fedorahosted.org/freeipa/changeset/1166fbc4946596fcc2ed51a1ec6990fc7dae8964
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/247#issuecomment-261535708
-- 
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] [freeipa PR#247][closed] Add 'ipa local-env' subcommand

2016-11-18 Thread martbab
   URL: https://github.com/freeipa/freeipa/pull/247
Author: tiran
 Title: #247: Add 'ipa local-env' subcommand
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/247/head:pr247
git checkout pr247
-- 
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] [freeipa PR#247][+ack] Add 'ipa local-env' subcommand

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/247
Title: #247: Add 'ipa local-env' subcommand

Label: +ack
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

martbab commented:
"""
Oh right, ok. My code reading skills are sub-par today. 
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261534814
-- 
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] [freeipa PR#254][synchronized] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/254
Author: tiran
 Title: #254: Replace LooseVersion with parse_ipa_version()
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/254/head:pr254
git checkout pr254
From e49896c316bae2a6ea4f3b37973a024fd024a0a8 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:24:09 +0100
Subject: [PATCH 1/3] Minor fixes for IPAVersion class

Py3: classes with __eq__ must provide __hash__ function or set __hash__
to None.
Comparison function like __eq__ must signal unsupported types by
returning NotImplemented. Python turns this in a proper TypeError.
Make the version member read-only and cache _bytes represention.

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index dbe005a..5d627be 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -83,20 +83,26 @@ def selinux_enabled():
 class IPAVersion(object):
 
 def __init__(self, version):
-self.version = version
+self._version = version
+self._bytes = version.encode('utf-8')
 
 @property
-def _bytes(self):
-return self.version.encode('utf-8')
+def version(self):
+return self._version
 
 def __eq__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) == 0
 
 def __lt__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) < 0
 
+def __hash__(self):
+return hash(self._version)
+
 
 class RedHatTaskNamespace(BaseTaskNamespace):
 

From dd47e974bb497c296ae505fbc320a95e3221c95e Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:45:13 +0100
Subject: [PATCH 2/3] Break ipalib.x509 import cycle

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index 5d627be..74ca5f1 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -44,8 +44,6 @@
 from ipapython import ipautil
 import ipapython.errors
 
-from ipalib import x509 # FIXME: do not import from ipalib
-
 from ipaplatform.constants import constants
 from ipaplatform.paths import paths
 from ipaplatform.redhat.authconfig import RedHatAuthConfig
@@ -220,6 +218,9 @@ def reload_systemwide_ca_store(self):
 return True
 
 def insert_ca_certs_into_systemwide_ca_store(self, ca_certs):
+# break import cycle
+from ipalib import x509
+
 new_cacert_path = paths.SYSTEMWIDE_IPA_CA_CRT
 
 if os.path.exists(new_cacert_path):

From 87265d9a7d849ea78f8e1e5b416f5b934637b7cb Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 09:26:18 +0100
Subject: [PATCH 3/3] Replace LooseVersion with tasks.parse_ipa_version

pylint is having a hard time with distutils.version in tox's virtual
envs. virtualenv uses some tricks to provide a virtual distutils
package, pylint can't cope with.

https://github.com/PyCQA/pylint/issues/73 suggests to use pkg_resources
instead. parse_version() can't handle some RPM-specific versions
correctly. Let's use our own version parser everywhere.

Signed-off-by: Christian Heimes 
---
 ipaclient/remote_plugins/compat.py | 13 ++---
 ipalib/capabilities.py |  6 +++---
 ipalib/frontend.py |  8 +++-
 ipalib/plugable.py |  7 +++
 ipaserver/install/krbinstance.py   |  6 +++---
 ipaserver/install/server/replicainstall.py |  7 +++
 6 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/ipaclient/remote_plugins/compat.py b/ipaclient/remote_plugins/compat.py
index 984eecd..b40bafb 100644
--- a/ipaclient/remote_plugins/compat.py
+++ b/ipaclient/remote_plugins/compat.py
@@ -2,7 +2,6 @@
 # Copyright (C) 2016  FreeIPA Contributors see COPYING for license
 #
 
-from distutils.version import LooseVersion
 import importlib
 import os
 import re
@@ -12,6 +11,7 @@
 
 from ipaclient.frontend import ClientCommand, ClientMethod
 from ipalib.frontend import Object
+from ipaplatform.tasks import tasks
 
 if six.PY3:
 unicode = str
@@ -58,7 +58,7 @@ def get_package(server_info, client):
 server_info['version'] = server_version
 server_info.update_validity()
 
-server_version = LooseVersion(server_version)
+server_version = 

[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

tiran commented:
"""
> I was thinking about this a bit, and was wondering whether the 
> platform-specific idiosyncracies of the version handling could be safely 
> confined to the platform-specific code. I.E ipaplatform.base would define 
> version comparisons via standard pkg_resources parser and fedora/redhat would 
> override this with their platform-specific quirks.

Somebody used a time machine and implemented your proposal already. 
```tasks.parse_ipa_version()``` is a generic version parsing function. On RPM 
platforms it returns an object that uses ```librpm```.

IMHO it's ok to use ```tasks.parse_ipa_version()``` everywhere. 
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261533679
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

martbab commented:
"""
Upon closer inspection of the affected code it seems that all the code in 
ipalib/ipaclient/ipapython actually parses and compares API versions, which are 
sane and parseable by `pkg_resources`. Since client code should be concerned by 
API versions and not by platform-specific package versions (that is server's 
job) it seems that you do not even need to use ipaplatform hammer in this case.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261519559
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

martbab commented:
"""
I was thinking about this a bit, and was wondering whether the 
platform-specific idiosyncracies of the version handling could be safely 
confined to the platform-specific code. I.E ipaplatform.base would define 
version comparisons via standard `pkg_resources` parser and fedora/redhat would 
override this with their platform-specific quirks.

The one thing that could be broken by this would be scenarios like Fedora 
clients talking to RHEL masters etc., but I think those sceniarios are not 
handled correctly by the current implementation anyway.

Another thing I was thinking about is whether we could use some proxy object in 
ipalib/ipaclient/ipapython libs which would use version comparison from 
ipaplatform if present, and if not use standard Python algorithms.

What I am aiming at that we should reduce the dependency of the PyPI candidate 
code on ipaplatform madness as much as is humanly possible. IMHO if we really 
want to use these modules in PyPI, then they ideally should not depend on 
ipaplatform at all.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261517612
-- 
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] [freeipa PR#238][comment] Build system refactoring phase 8: update translation system

2016-11-18 Thread lslebodn
  URL: https://github.com/freeipa/freeipa/pull/238
Title: #238: Build system refactoring phase 8: update translation system

lslebodn commented:
"""
>Your patch adds `config.rpath`. Is it necessary to include the file in source 
>control? certmonger and sssd use the file but don't have it in git.

Following patch fixes this issue
http://paste.fedoraproject.org/484212/47049414/
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/238#issuecomment-261516489
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with parse_ipa_version()

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with parse_ipa_version()

tiran commented:
"""
I reworked my PR to use ```tasks.parse_ipa_version()``` for all version number 
checks. Of course I ran into the import cycle of death. I broke the cycle with 
a local import. It's not perfect but a completely fine solution. The function 
isn't called regularly.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261515550
-- 
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] [freeipa PR#254][synchronized] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/254
Author: tiran
 Title: #254: Replace LooseVersion with pkg_resources.parse_version
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/254/head:pr254
git checkout pr254
From e49896c316bae2a6ea4f3b37973a024fd024a0a8 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:24:09 +0100
Subject: [PATCH 1/3] Minor fixes for IPAVersion class

Py3: classes with __eq__ must provide __hash__ function or set __hash__
to None.
Comparison function like __eq__ must signal unsupported types by
returning NotImplemented. Python turns this in a proper TypeError.
Make the version member read-only and cache _bytes represention.

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index dbe005a..5d627be 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -83,20 +83,26 @@ def selinux_enabled():
 class IPAVersion(object):
 
 def __init__(self, version):
-self.version = version
+self._version = version
+self._bytes = version.encode('utf-8')
 
 @property
-def _bytes(self):
-return self.version.encode('utf-8')
+def version(self):
+return self._version
 
 def __eq__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) == 0
 
 def __lt__(self, other):
-assert isinstance(other, IPAVersion)
+if not isinstance(other, IPAVersion):
+return NotImplemented
 return _librpm.rpmvercmp(self._bytes, other._bytes) < 0
 
+def __hash__(self):
+return hash(self._version)
+
 
 class RedHatTaskNamespace(BaseTaskNamespace):
 

From dd47e974bb497c296ae505fbc320a95e3221c95e Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 12:45:13 +0100
Subject: [PATCH 2/3] Break ipalib.x509 import cycle

Signed-off-by: Christian Heimes 
---
 ipaplatform/redhat/tasks.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
index 5d627be..74ca5f1 100644
--- a/ipaplatform/redhat/tasks.py
+++ b/ipaplatform/redhat/tasks.py
@@ -44,8 +44,6 @@
 from ipapython import ipautil
 import ipapython.errors
 
-from ipalib import x509 # FIXME: do not import from ipalib
-
 from ipaplatform.constants import constants
 from ipaplatform.paths import paths
 from ipaplatform.redhat.authconfig import RedHatAuthConfig
@@ -220,6 +218,9 @@ def reload_systemwide_ca_store(self):
 return True
 
 def insert_ca_certs_into_systemwide_ca_store(self, ca_certs):
+# break import cycle
+from ipalib import x509
+
 new_cacert_path = paths.SYSTEMWIDE_IPA_CA_CRT
 
 if os.path.exists(new_cacert_path):

From 7d5b902b26ac457cdf3d8959849ec784c4a39314 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 09:26:18 +0100
Subject: [PATCH 3/3] Replace LooseVersion with tasks.parse_ipa_version

pylint is having a hard time with distutils.version in tox's virtual
envs. virtualenv uses some tricks to provide a virtual distutils
package, pylint can't cope with.

https://github.com/PyCQA/pylint/issues/73 suggests to use pkg_resources
instead. parse_version() can't handle some RPM-specific versions
correctly. Let's use our own version parser everywhere.

Signed-off-by: Christian Heimes 
---
 ipaclient/remote_plugins/compat.py | 13 ++---
 ipalib/capabilities.py |  6 +++---
 ipalib/frontend.py |  8 +++-
 ipalib/plugable.py |  7 +++
 ipaserver/install/krbinstance.py   |  6 +++---
 ipaserver/install/server/replicainstall.py |  3 +--
 6 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/ipaclient/remote_plugins/compat.py b/ipaclient/remote_plugins/compat.py
index 984eecd..b40bafb 100644
--- a/ipaclient/remote_plugins/compat.py
+++ b/ipaclient/remote_plugins/compat.py
@@ -2,7 +2,6 @@
 # Copyright (C) 2016  FreeIPA Contributors see COPYING for license
 #
 
-from distutils.version import LooseVersion
 import importlib
 import os
 import re
@@ -12,6 +11,7 @@
 
 from ipaclient.frontend import ClientCommand, ClientMethod
 from ipalib.frontend import Object
+from ipaplatform.tasks import tasks
 
 if six.PY3:
 unicode = str
@@ -58,7 +58,7 @@ def get_package(server_info, client):
 server_info['version'] = server_version
 server_info.update_validity()
 
-server_version = LooseVersion(server_version)
+server_version = 

[Freeipa-devel] [freeipa PR#238][comment] Build system refactoring phase 8: update translation system

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/238
Title: #238: Build system refactoring phase 8: update translation system

tiran commented:
"""
Your patch adds ```config.rpath```. Is it necessary to include the file in 
source control? certmonger and sssd use the file but don't have it in git.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/238#issuecomment-261504800
-- 
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] [bind-dyndb-ldap PR#1][comment] Port bind-dyndb-ldap to BIND 9.11

2016-11-18 Thread pspacek
  URL: https://github.com/freeipa/bind-dyndb-ldap/pull/1
Title: #1: Port bind-dyndb-ldap to BIND 9.11

pspacek commented:
"""
@stutiredboy There is probably a issue in path overriding logic. I will take 
care of this in separate PR because it works when you have BIND 9.11 installed 
in default paths.
"""

See the full comment at 
https://github.com/freeipa/bind-dyndb-ldap/pull/1#issuecomment-261504482
-- 
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] [bind-dyndb-ldap PR#1][+ack] Port bind-dyndb-ldap to BIND 9.11

2016-11-18 Thread pspacek
  URL: https://github.com/freeipa/bind-dyndb-ldap/pull/1
Title: #1: Port bind-dyndb-ldap to BIND 9.11

Label: +ack
-- 
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] [freeipa PR#245][comment] Allow full customisability of IPA CA subject DN

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/245
Title: #245: Allow full customisability of IPA CA subject DN

tiran commented:
"""
flake8 violation: ```./ipaserver/plugins/migration.py:750:80: E501 line too 
long (83 > 79 characters)```
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/245#issuecomment-261504171
-- 
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] [freeipa PR#257][opened] Don't ship install subpackages with wheels

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/257
Author: tiran
 Title: #257: Don't ship install subpackages with wheels
Action: opened

PR body:
"""
The install subpackages of ipaclient, ipalib and ipapython contain
helper code for installers such as ipa-client-install. They also depend
on external modules that are not available on PyPI, e.g. SSSDConfig.
Since PyPI wheel packages do not support client installation, the
install subpackages contain dead and unsupported code.

The custom build_py plugin removes the subpackages from bdist_wheel
builds. It's not enough to just remove 'ipaclient.install' from the
'packages' list. Surplus files have to be removed from build/lib, too.

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

Signed-off-by: Christian Heimes 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/257/head:pr257
git checkout pr257
From 71428d0962961991d6bdfe731f9258b3451b986e Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 11:42:16 +0100
Subject: [PATCH] Don't ship install subpackages with wheels

The install subpackages of ipaclient, ipalib and ipapython contain
helper code for installers such as ipa-client-install. They also depend
on external modules that are not available on PyPI, e.g. SSSDConfig.
Since PyPI wheel packages do not support client installation, the
install subpackages contain dead and unsupported code.

The custom build_py plugin removes the subpackages from bdist_wheel
builds. It's not enough to just remove 'ipaclient.install' from the
'packages' list. Surplus files have to be removed from build/lib, too.

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

Signed-off-by: Christian Heimes 
---
 ipasetup.py.in | 36 
 pylintrc   |  3 +++
 2 files changed, 39 insertions(+)

diff --git a/ipasetup.py.in b/ipasetup.py.in
index 5330956..fac4b25 100644
--- a/ipasetup.py.in
+++ b/ipasetup.py.in
@@ -14,8 +14,41 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
 #
+from distutils import log
 import os
 import sys
+from setuptools.command.build_py import build_py as setuptools_build_py
+
+
+class build_py(setuptools_build_py):
+"""Exclude NAME.install subpackage from wheels
+"""
+def initialize_options(self):
+setuptools_build_py.initialize_options(self)
+self.skip_package = None
+
+def finalize_options(self):
+setuptools_build_py.finalize_options(self)
+if 'bdist_wheel' in self.distribution.commands:
+distname = self.distribution.metadata.name
+self.skip_package = '{}.install'.format(distname)
+log.warn("bdist_wheel: Ignore package: %s",
+ self.skip_package)
+
+def build_module(self, module, module_file, package):
+if isinstance(package, str):
+package = package.split('.')
+name = '.'.join(list(package) + [module])
+if self.skip_package and name.startswith(self.skip_package):
+# remove file in case it has been copied to build/lib before
+outfile = self.get_module_outfile(self.build_lib, package, module)
+try:
+os.unlink(outfile)
+except OSError:
+pass
+else:
+return setuptools_build_py.build_module(self, module,
+module_file, package)
 
 
 PACKAGE_VERSION = {
@@ -89,6 +122,9 @@ def ipasetup(name, doc, **kwargs):
 # exclude setup helpers from getting installed
 epd = setup_kwargs.setdefault('exclude_package_data', {})
 epd.setdefault('', []).extend(['*/setup.py', '*/ipasetup.py'])
+# exclude NAME.install from wheels
+cmdclass = setup_kwargs.setdefault('cmdclass', {})
+cmdclass['build_py'] = build_py
 
 os.chdir(local_path)
 try:
diff --git a/pylintrc b/pylintrc
index 07acb1f..2a7a9cd 100644
--- a/pylintrc
+++ b/pylintrc
@@ -9,6 +9,9 @@ load-plugins=pylint_plugins
 # Use multiple processes to speed up Pylint.
 jobs=0
 
+# safe C extensions
+extension-pkg-whitelist=_ldap,cryptography,gssapi,netifaces,nss
+
 [MESSAGES CONTROL]
 
 enable=
-- 
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] [freeipa PR#256][opened] Pylint: whitelist packages with extension modules

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/256
Author: tiran
 Title: #256: Pylint: whitelist packages with extension modules
Action: opened

PR body:
"""
Pylint refuses to load extension modules from unsafe places. This
triggers import-error failures for pylint runs inside a tox virtualenv.
Any module or package in extension-pkg-whitelist is whitelisted and
pylint imports extension modules.

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

Signed-off-by: Christian Heimes 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/256/head:pr256
git checkout pr256
From 7c761ceb554dfbc5ab13a781f9ca80fbd6be2e03 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 11:31:36 +0100
Subject: [PATCH] Pylint: whitelist packages with extension modules

Pylint refuses to load extension modules from unsafe places. This
triggers import-error failures for pylint runs inside a tox virtualenv.
Any module or package in extension-pkg-whitelist is whitelisted and
pylint imports extension modules.

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

Signed-off-by: Christian Heimes 
---
 pylintrc | 9 +
 1 file changed, 9 insertions(+)

diff --git a/pylintrc b/pylintrc
index 07acb1f..93075f5 100644
--- a/pylintrc
+++ b/pylintrc
@@ -9,6 +9,15 @@ load-plugins=pylint_plugins
 # Use multiple processes to speed up Pylint.
 jobs=0
 
+# A list of packages with safe C extensions to load
+extension-pkg-whitelist=
+_ldap,
+cryptography,
+gssapi,
+netifaces,
+nss
+
+
 [MESSAGES CONTROL]
 
 enable=
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with pkg_resources.parse_version

martbab commented:
"""
Yes that's why we resorted to a direct CFFI call to RPM libs during server 
version check in upgrade. We simply could not win aside from re-implementing 
parsing of Z-stream versions etc. from scratch.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261500197
-- 
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] [freeipa PR#253][+rejected] Add .eggs to Gitignore

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/253
Title: #253: Add .eggs to Gitignore

Label: +rejected
-- 
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] [freeipa PR#253][closed] Add .eggs to Gitignore

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/253
Author: pspacek
 Title: #253: Add .eggs to Gitignore
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/253/head:pr253
git checkout pr253
-- 
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] [freeipa PR#253][comment] Add .eggs to Gitignore

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/253
Title: #253: Add .eggs to Gitignore

tiran commented:
"""
#255 takes care of .eggs and some other minor issues in setup.py.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/253#issuecomment-261496632
-- 
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] [freeipa PR#255][synchronized] Adjustments for setup requirements

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/255
Author: tiran
 Title: #255: Adjustments for setup requirements
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/255/head:pr255
git checkout pr255
From e2b55aefa215e9bf7a7187564b85863dd008bc64 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 17 Nov 2016 16:43:17 +0100
Subject: [PATCH] Adjustments for setup requirements

Fix some typos, missing or surplus dependencies. Remove setup
requirement on wheel since it triggers download. ipatests is now
installable. Tests need further changes to be runable.

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

Signed-off-by: Christian Heimes 
---
 ipaclient/setup.py   |  8 ++--
 ipalib/setup.py  |  4 +---
 ipaplatform/setup.py |  3 ---
 ipapython/setup.py   |  4 +---
 ipaserver/setup.py   |  3 ---
 ipasetup.py.in   |  5 +++--
 ipatests/setup.py| 17 -
 7 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/ipaclient/setup.py b/ipaclient/setup.py
index fc5609b..e3ec079 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -48,13 +48,9 @@
 "ipalib",
 "ipapython",
 "python-nss",
+"python-yubico",
+"pyusb",
 "qrcode",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
-extra_requires={
-"otptoken_yubikey": ["yubico", "usb"]
-}
 )
diff --git a/ipalib/setup.py b/ipalib/setup.py
index 98af7ab..94d78de 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -41,10 +41,8 @@
 "ipapython",
 "netaddr",
 "pyasn1",
+"pyasn1-modules",
 "python-nss",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipaplatform/setup.py b/ipaplatform/setup.py
index 97311de..98a9f08 100644
--- a/ipaplatform/setup.py
+++ b/ipaplatform/setup.py
@@ -46,7 +46,4 @@
 "python-nss",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipapython/setup.py b/ipapython/setup.py
index 087086e..772ecfd 100755
--- a/ipapython/setup.py
+++ b/ipapython/setup.py
@@ -54,11 +54,9 @@
 "requests",
 "six",
 ],
-setup_requires=[
-"wheel",
-],
 extras_require={
 ":python_version<'3'": ["enum34"],
+"certmonger": ["dbus-python"],
 },
 entry_points={
 'custodia.authorizers': [
diff --git a/ipaserver/setup.py b/ipaserver/setup.py
index 5c38843..2009042 100755
--- a/ipaserver/setup.py
+++ b/ipaserver/setup.py
@@ -66,7 +66,4 @@
 # "python-SSSDConfig",
 # "samba-python",
 ],
-setup_requires=[
-"wheel",
-],
 )
diff --git a/ipasetup.py.in b/ipasetup.py.in
index 5330956..73bbb8d 100644
--- a/ipasetup.py.in
+++ b/ipasetup.py.in
@@ -19,9 +19,9 @@ import sys
 
 
 PACKAGE_VERSION = {
-'cryptography': 'cryptography >= 0.9',
+'cryptography': 'cryptography >= 1.5',
 'dnspython': 'dnspython >= 1.11.1',
-'gssapi': 'gssapi > 1.1.2',
+'gssapi': 'gssapi >= 1.2.0',
 'ipaclient': 'ipaclient == @VERSION@',
 'ipalib': 'ipalib == @VERSION@',
 'ipaplatform': 'ipaplatform == @VERSION@',
@@ -31,6 +31,7 @@ PACKAGE_VERSION = {
 'netifaces': 'netifaces >= 0.10.4',
 'python-nss': 'python-nss >= 0.16',
 'pyldap': 'pyldap >= 2.4.15',
+'pytest': 'pytest < 3.0',
 'qrcode': 'qrcode >= 5.0',
 # 'yubico': 'yubico >= 1.2.3',
 }
diff --git a/ipatests/setup.py b/ipatests/setup.py
index 26f0124..b57226d 100644
--- a/ipatests/setup.py
+++ b/ipatests/setup.py
@@ -59,24 +59,23 @@
 },
 install_requires=[
 "cryptography",
-"dbus-python",
 "dnspython",
-"dogtag-pki",
+"gssapi",
 "ipaclient",
 "ipalib",
 "ipaplatform",
 "ipapython",
-"ipaserver",
 "nose",
 "pyldap",
 "pytest",
-"python-gssapi",
+"pytest_multihost",
 "python-nss",
-"selenium",
 "six",
-"yaml",
-],
-setup_requires=[
-"wheel",
 ],
+extras_require={
+"integration": ["dbus-python", "pyyaml", "ipaserver"],
+"ipaserver": ["ipaserver"],
+"webui": ["selenium", "pyyaml", "ipaserver"],
+"xmlrpc": ["ipaserver"],
+}
 )
-- 
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] [freeipa PR#255][opened] Adjustments for setup requirements

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/255
Author: tiran
 Title: #255: Adjustments for setup requirements
Action: opened

PR body:
"""
Fix some typos, missing or surplus dependencies. ipatests is now
installable. Tests need further changes to be runable.

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

Signed-off-by: Christian Heimes 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/255/head:pr255
git checkout pr255
From 9111930c26971e276ba6b29a7e5620c057d96281 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 17 Nov 2016 16:43:17 +0100
Subject: [PATCH] Adjustments for setup requirements

Fix some typos, missing or surplus dependencies. ipatests is now
installable. Tests need further changes to be runable.

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

Signed-off-by: Christian Heimes 
---
 ipaclient/setup.py |  5 ++---
 ipalib/setup.py|  1 +
 ipapython/setup.py |  1 +
 ipasetup.py.in |  5 +++--
 ipatests/setup.py  | 14 --
 5 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/ipaclient/setup.py b/ipaclient/setup.py
index fc5609b..2c10353 100644
--- a/ipaclient/setup.py
+++ b/ipaclient/setup.py
@@ -48,13 +48,12 @@
 "ipalib",
 "ipapython",
 "python-nss",
+"python-yubico",
+"pyusb",
 "qrcode",
 "six",
 ],
 setup_requires=[
 "wheel",
 ],
-extra_requires={
-"otptoken_yubikey": ["yubico", "usb"]
-}
 )
diff --git a/ipalib/setup.py b/ipalib/setup.py
index 98af7ab..a2d113c 100644
--- a/ipalib/setup.py
+++ b/ipalib/setup.py
@@ -41,6 +41,7 @@
 "ipapython",
 "netaddr",
 "pyasn1",
+"pyasn1-modules",
 "python-nss",
 "six",
 ],
diff --git a/ipapython/setup.py b/ipapython/setup.py
index 087086e..6743205 100755
--- a/ipapython/setup.py
+++ b/ipapython/setup.py
@@ -59,6 +59,7 @@
 ],
 extras_require={
 ":python_version<'3'": ["enum34"],
+"certmonger": ["dbus-python"],
 },
 entry_points={
 'custodia.authorizers': [
diff --git a/ipasetup.py.in b/ipasetup.py.in
index 5330956..73bbb8d 100644
--- a/ipasetup.py.in
+++ b/ipasetup.py.in
@@ -19,9 +19,9 @@ import sys
 
 
 PACKAGE_VERSION = {
-'cryptography': 'cryptography >= 0.9',
+'cryptography': 'cryptography >= 1.5',
 'dnspython': 'dnspython >= 1.11.1',
-'gssapi': 'gssapi > 1.1.2',
+'gssapi': 'gssapi >= 1.2.0',
 'ipaclient': 'ipaclient == @VERSION@',
 'ipalib': 'ipalib == @VERSION@',
 'ipaplatform': 'ipaplatform == @VERSION@',
@@ -31,6 +31,7 @@ PACKAGE_VERSION = {
 'netifaces': 'netifaces >= 0.10.4',
 'python-nss': 'python-nss >= 0.16',
 'pyldap': 'pyldap >= 2.4.15',
+'pytest': 'pytest < 3.0',
 'qrcode': 'qrcode >= 5.0',
 # 'yubico': 'yubico >= 1.2.3',
 }
diff --git a/ipatests/setup.py b/ipatests/setup.py
index 26f0124..1175b05 100644
--- a/ipatests/setup.py
+++ b/ipatests/setup.py
@@ -59,24 +59,26 @@
 },
 install_requires=[
 "cryptography",
-"dbus-python",
 "dnspython",
-"dogtag-pki",
+"gssapi",
 "ipaclient",
 "ipalib",
 "ipaplatform",
 "ipapython",
-"ipaserver",
 "nose",
 "pyldap",
 "pytest",
-"python-gssapi",
+"pytest_multihost",
 "python-nss",
-"selenium",
 "six",
-"yaml",
 ],
 setup_requires=[
 "wheel",
 ],
+extras_require={
+"integration": ["dbus-python", "pyyaml", "ipaserver"],
+"ipaserver": ["ipaserver"],
+"webui": ["selenium", "pyyaml", "ipaserver"],
+"xmlrpc": ["ipaserver"],
+}
 )
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with pkg_resources.parse_version

tiran commented:
"""
sigh, you are right, parse_version does not handle one version comparison as we 
expect: ```4.2.0-15.el7 < 4.2.0-15.el7_2.3``` 

```
from __future__ import print_function
import operator
import pkg_resources


version_strings = [
("3.0.0-1.el6", "3.0.0-2.el6", operator.lt),
("3.0.0-1.el6_8", "3.0.0-1.el6_8.1", operator.lt),
("3.0.0-42.el6", "3.0.0-1.el6", operator.gt),
("3.0.0-1.el6", "3.0.0-42.el6", operator.lt),
("3.0.0-42.el6", "3.3.3-1.fc20", operator.lt),
("4.2.0-15.el7", "4.2.0-15.el7_2.3", operator.lt),
("4.2.0-15.el7_2", "4.2.0-15.el7_2.3", operator.lt),
("4.2.0-15.el7_2.3", "4.2.0-15.el7_2.3", operator.eq),
("4.2.0-15.el7_2.3", "4.2.0-15.el7_2.2", operator.gt),
("4.2.0-1.fc23", "4.2.1-1.fc23", operator.lt),
("4.2.3-alpha1.fc23", "4.2.3-2.fc23", operator.lt),
("4.3.90.201601080923GIT55aeea7-0.fc23", "4.3.0-1.fc23", operator.gt)
]

for v1, v2, op in version_strings:
v1 = pkg_resources.parse_version(v1)
v2 = pkg_resources.parse_version(v2)
if not op(v1, v2):
print("failure: ", v1, op.__name__, v2)
```

```
$ python v.py 
failure:  4.2.0-15.el7 lt 4.2.0-15.el7_2.3
```
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261491515
-- 
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] [freeipa PR#253][comment] Add .eggs to Gitignore

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/253
Title: #253: Add .eggs to Gitignore

tiran commented:
"""
Ah, you don't have python-wheel installed. The package download is triggered by 
```setup_requires=["wheel"]```. I assumed that Fedora installs the wheel 
package with pip. Apparently it does not. Since RHEL and CentOS do not have a 
python-wheel package, we can't work fix the problem with a build requirement. I 
have to remove ```setup_requires```.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/253#issuecomment-261488060
-- 
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] [freeipa PR#251][comment] Add rebuild rule for template files

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/251
Title: #251: Add rebuild rule for template files

tiran commented:
"""
I created a ticket for you, https://fedorahosted.org/freeipa/ticket/6498 . 

This **exact (!)** AC_SUBST works for me. Additional newlines cause 
CONFIG_STATUS_DEPENDENCIES to be an empty rule.
```
# re-run configure after templates have been altered
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
 ['$(top_srcdir)/daemons/ipa-version.h.in $(top_srcdir)/freeipa.spec.in 
$(top_srcdir)/ipapython/version.py.in $(top_srcdir)/ipasetup.py.in 
$(top_srcdir)/install/ui/src/libs/loader.js.in'])
```
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/251#issuecomment-261485319
-- 
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] [freeipa PR#253][comment] Add .eggs to Gitignore

2016-11-18 Thread pspacek
  URL: https://github.com/freeipa/freeipa/pull/253
Title: #253: Add .eggs to Gitignore

pspacek commented:
"""
I'm using this script to build IPA:
~~~
rm -rvf ~/rpmbuild/{BUILD,BUILDROOT,SPECS,SOURCES,RPMS,SRPMS}
mkdir -pv ~/rpmbuild/{BUILD,BUILDROOT,SPECS,SOURCES,RPMS,SRPMS}
autoreconf -i
./configure
make dist
cp freeipa-*.tar.gz ~/rpmbuild/SOURCES/
cp freeipa.spec ~/rpmbuild/SPECS/
rpmbuild --noclean -ba ~/rpmbuild/SPECS/freeipa.spec
~~~

The ipapython/.eggs directory contains this:
~~~
ipapython/.eggs
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/pep425tags.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/install.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_keys.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist/setup.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist/simpledist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist/simpledist/__init__.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist/simpledist/__init__.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/simple.dist/setup.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_paths.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_signatures.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_wheelfile.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_keys.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test-1.0-py2.py3-none-win32.whl
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_wheelfile.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist/header.h
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist/setup.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist/headersdist.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist/headersdist.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/headers.dist/setup.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_basic.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_install.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/__init__.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_tool.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_paths.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_ranking.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/conftest.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_ranking.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_signatures.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_tagopt.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_basic.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/conftest.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_install.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/pydist-schema.json
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist/setup.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist/setup.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist/complexdist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist/complexdist/__init__.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/complex-dist/complexdist/__init__.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/extension.dist
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/extension.dist/setup.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/extension.dist/setup.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_tool.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/__init__.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/test/test_tagopt.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/install.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/decorator.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/pkginfo.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/pep425tags.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/eggnames.txt
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/paths.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/bdist_wheel.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/decorator.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/egg2wheel.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/__main__.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/signatures
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/signatures/keys.py
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/signatures/ed25519py.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/signatures/djbec.pyc
ipapython/.eggs/wheel-0.30.0a0-py2.7.egg/wheel/signatures/__init__.py

[Freeipa-devel] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread martbab
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with pkg_resources.parse_version

martbab commented:
"""
I have a sneaky suspicion that the parse_version couldn't cope correctly with 
some of the downstream versioning schemes like RHEL z-stream releases and such.

That should be OK with API version, but client/server versions can pose a 
problem. There is are some examples in the 
ipatests/test_ipaserver/test_version_comparison.py I made when solving a bug 
that was caused by incorrect version comparison. Can you check if parse_version 
can handle them correctly?
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261479903
-- 
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] [freeipa PR#253][comment] Add .eggs to Gitignore

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/253
Title: #253: Add .eggs to Gitignore

tiran commented:
"""
I can't reproduce the issue locally. What's inside your .eggs directory? It's 
used by setuptools.dist to cache install, build and test dependencies. It 
should not be generated in the first place.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/253#issuecomment-261477882
-- 
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] [freeipa PR#254][comment] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread tiran
  URL: https://github.com/freeipa/freeipa/pull/254
Title: #254: Replace LooseVersion with pkg_resources.parse_version

tiran commented:
"""
The PR is related to integration improvements and pip-installable effort, 
https://fedorahosted.org/freeipa/ticket/6468.
"""

See the full comment at 
https://github.com/freeipa/freeipa/pull/254#issuecomment-261476303
-- 
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] [freeipa PR#254][opened] Replace LooseVersion with pkg_resources.parse_version

2016-11-18 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/254
Author: tiran
 Title: #254: Replace LooseVersion with pkg_resources.parse_version
Action: opened

PR body:
"""
pylint is having a hard time with distutils.version in tox's virtual
envs. virtualenv uses some tricks to provide a virtual distutils
package, pylint can't cope with.

https://github.com/PyCQA/pylint/issues/73 suggests to use pkg_resources
instead. pkg_resources' version parser has some more benefits, e.g. PEP
440 conformity.

Signed-off-by: Christian Heimes 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/254/head:pr254
git checkout pr254
From 657f889a64c637444e67008138bdb22f9b078499 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Fri, 18 Nov 2016 09:26:18 +0100
Subject: [PATCH] Replace LooseVersion with pkg_resources.parse_version

pylint is having a hard time with distutils.version in tox's virtual
envs. virtualenv uses some tricks to provide a virtual distutils
package, pylint can't cope with.

https://github.com/PyCQA/pylint/issues/73 suggests to use pkg_resources
instead. pkg_resources' version parser has some more benefits, e.g. PEP
440 conformity.

Signed-off-by: Christian Heimes 
---
 ipaclient/remote_plugins/compat.py | 10 +-
 ipalib/capabilities.py |  6 +++---
 ipalib/frontend.py |  8 +++-
 ipalib/plugable.py |  7 +++
 ipaserver/install/krbinstance.py   |  7 ---
 ipaserver/install/server/replicainstall.py |  4 ++--
 6 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/ipaclient/remote_plugins/compat.py b/ipaclient/remote_plugins/compat.py
index 984eecd..8635079 100644
--- a/ipaclient/remote_plugins/compat.py
+++ b/ipaclient/remote_plugins/compat.py
@@ -2,12 +2,12 @@
 # Copyright (C) 2016  FreeIPA Contributors see COPYING for license
 #
 
-from distutils.version import LooseVersion
 import importlib
 import os
 import re
 import sys
 
+from pkg_resources import parse_version
 import six
 
 from ipaclient.frontend import ClientCommand, ClientMethod
@@ -58,7 +58,7 @@ def get_package(server_info, client):
 server_info['version'] = server_version
 server_info.update_validity()
 
-server_version = LooseVersion(server_version)
+server_version = parse_version(server_version)
 
 package_names = {}
 base_name = __name__.rpartition('.')[0]
@@ -70,11 +70,11 @@ def get_package(server_info, client):
 package_names[package_version] = '{}.{}'.format(base_name, name)
 
 package_version = None
-for version in sorted(package_names, key=LooseVersion):
+for version in sorted(package_names, key=parse_version):
 if (package_version is None or
-LooseVersion(package_version) < LooseVersion(version)):
+parse_version(package_version) < parse_version(version)):
 package_version = version
-if LooseVersion(version) >= server_version:
+if parse_version(version) >= server_version:
 break
 
 package_name = package_names[package_version]
diff --git a/ipalib/capabilities.py b/ipalib/capabilities.py
index 7ddaea2..a01faeb 100644
--- a/ipalib/capabilities.py
+++ b/ipalib/capabilities.py
@@ -25,7 +25,7 @@
 versions they were introduced in.
 """
 
-from distutils import version
+from pkg_resources import parse_version
 
 VERSION_WITHOUT_CAPABILITIES = u'2.51'
 
@@ -64,6 +64,6 @@ def client_has_capability(client_version, capability):
 :param client_version: The API version string reported by the client
 """
 
-version_tuple = version.LooseVersion(client_version)
+version_tuple = parse_version(client_version)
 
-return version_tuple >= version.LooseVersion(capabilities[capability])
+return version_tuple >= parse_version(capabilities[capability])
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index c94d174..d5890b0 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -20,9 +20,7 @@
 """
 Base classes for all front-end plugins.
 """
-
-from distutils import version
-
+from pkg_resources import parse_version
 import six
 
 from ipapython.version import API_VERSION
@@ -770,8 +768,8 @@ def verify_client_version(self, client_version):
 If the client minor version is less than or equal to the server
 then let the request proceed.
 """
-server_ver = version.LooseVersion(API_VERSION)
-ver = version.LooseVersion(client_version)
+server_ver = parse_version(API_VERSION)
+ver = parse_version(client_version)
 if len(ver.version) < 2:
 raise VersionError(cver=ver.version, sver=server_ver.version, server= self.env.xmlrpc_uri)
 client_major = ver.version[0]
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 76fb9fd..5d3ccfe 100644
--- a/ipalib/plugable.py
+++