Tomas Krizek efb3bf4
From 307c4bd62609c9ac58633e3ccc61d85e2caacbcc Mon Sep 17 00:00:00 2001
Tomas Krizek efb3bf4
From: Christian Heimes <cheimes@redhat.com>
Tomas Krizek efb3bf4
Date: Wed, 3 May 2017 16:38:21 +0200
Tomas Krizek efb3bf4
Subject: [PATCH] Run ipa-custodia under Python 2
Tomas Krizek efb3bf4
Tomas Krizek efb3bf4
Closes: https://pagure.io/freeipa/issue/6926
Tomas Krizek efb3bf4
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Tomas Krizek efb3bf4
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Tomas Krizek efb3bf4
---
Tomas Krizek efb3bf4
 freeipa.spec.in                   | 10 ++++++----
Tomas Krizek efb3bf4
 init/systemd/ipa-custodia.service |  3 +--
Tomas Krizek efb3bf4
 install/tools/Makefile.am         |  1 +
Tomas Krizek efb3bf4
 install/tools/ipa-custodia        |  6 ++++++
Tomas Krizek efb3bf4
 4 files changed, 14 insertions(+), 6 deletions(-)
Tomas Krizek efb3bf4
 create mode 100755 install/tools/ipa-custodia
Tomas Krizek efb3bf4
Tomas Krizek efb3bf4
diff --git a/freeipa.spec.in b/freeipa.spec.in
Tomas Krizek efb3bf4
index e0f1df2..21f2416 100644
Tomas Krizek efb3bf4
--- a/freeipa.spec.in
Tomas Krizek efb3bf4
+++ b/freeipa.spec.in
Tomas Krizek efb3bf4
@@ -112,7 +112,8 @@ BuildRequires:  python-pytest-sourceorder
Tomas Krizek efb3bf4
 BuildRequires:  python-kdcproxy >= 0.3
Tomas Krizek efb3bf4
 BuildRequires:  python-six
Tomas Krizek efb3bf4
 BuildRequires:  python-jwcrypto
Tomas Krizek efb3bf4
-BuildRequires:  custodia
Tomas Krizek efb3bf4
+# install/tools/ipa-custodia needs custodia 0.2+
Tomas Krizek efb3bf4
+BuildRequires:  custodia >= 0.2
Tomas Krizek efb3bf4
 BuildRequires:  libini_config-devel >= 1.2.0
Tomas Krizek efb3bf4
 BuildRequires:  dbus-python
Tomas Krizek efb3bf4
 BuildRequires:  python-netifaces >= 0.10.4
Tomas Krizek efb3bf4
@@ -246,7 +247,7 @@ BuildArch: noarch
Tomas Krizek efb3bf4
 Requires: %{name}-client-common = %{version}-%{release}
Tomas Krizek efb3bf4
 Requires: httpd >= 2.4.6-31
Tomas Krizek efb3bf4
 Requires: systemd-units >= 38
Tomas Krizek efb3bf4
-Requires: custodia
Tomas Krizek efb3bf4
+Requires: custodia >= 0.2
Tomas Krizek efb3bf4
 
Tomas Krizek efb3bf4
 Provides: %{alt_name}-server-common = %{version}
Tomas Krizek efb3bf4
 Conflicts: %{alt_name}-server-common
Tomas Krizek efb3bf4
@@ -498,7 +499,7 @@ Requires: python-jwcrypto
Tomas Krizek efb3bf4
 Requires: python-cffi
Tomas Krizek efb3bf4
 Requires: python-ldap >= 2.4.15
Tomas Krizek efb3bf4
 Requires: python-requests
Tomas Krizek efb3bf4
-Requires: python-custodia
Tomas Krizek efb3bf4
+Requires: python-custodia >= 0.2
Tomas Krizek efb3bf4
 Requires: python-dns >= 1.13
Tomas Krizek efb3bf4
 Requires: python-netifaces >= 0.10.4
Tomas Krizek efb3bf4
 Requires: pyusb
Tomas Krizek efb3bf4
@@ -546,7 +547,7 @@ Requires: python3-six
Tomas Krizek efb3bf4
 Requires: python3-jwcrypto
Tomas Krizek efb3bf4
 Requires: python3-cffi
Tomas Krizek efb3bf4
 Requires: python3-pyldap >= 2.4.15
Tomas Krizek efb3bf4
-Requires: python3-custodia
Tomas Krizek efb3bf4
+Requires: python3-custodia >= 0.2
Tomas Krizek efb3bf4
 Requires: python3-requests
Tomas Krizek efb3bf4
 Requires: python3-dns >= 1.11.1
Tomas Krizek efb3bf4
 Requires: python3-netifaces >= 0.10.4
Tomas Krizek efb3bf4
@@ -1069,6 +1070,7 @@ fi
Tomas Krizek efb3bf4
 %{_libexecdir}/certmonger/ipa-server-guard
Tomas Krizek efb3bf4
 %{_libexecdir}/ipa-otpd
Tomas Krizek efb3bf4
 %dir %{_libexecdir}/ipa
Tomas Krizek efb3bf4
+%{_libexecdir}/ipa/ipa-custodia
Tomas Krizek efb3bf4
 %{_libexecdir}/ipa/ipa-dnskeysyncd
Tomas Krizek efb3bf4
 %{_libexecdir}/ipa/ipa-dnskeysync-replica
Tomas Krizek efb3bf4
 %{_libexecdir}/ipa/ipa-ods-exporter
Tomas Krizek efb3bf4
diff --git a/init/systemd/ipa-custodia.service b/init/systemd/ipa-custodia.service
Tomas Krizek efb3bf4
index ff930fb..63246c4 100644
Tomas Krizek efb3bf4
--- a/init/systemd/ipa-custodia.service
Tomas Krizek efb3bf4
+++ b/init/systemd/ipa-custodia.service
Tomas Krizek efb3bf4
@@ -3,8 +3,7 @@ Description=IPA Custodia Service
Tomas Krizek efb3bf4
 
Tomas Krizek efb3bf4
 [Service]
Tomas Krizek efb3bf4
 Type=simple
Tomas Krizek efb3bf4
-
Tomas Krizek efb3bf4
-ExecStart=/usr/sbin/custodia /etc/ipa/custodia/custodia.conf
Tomas Krizek efb3bf4
+ExecStart=/usr/libexec/ipa/ipa-custodia /etc/ipa/custodia/custodia.conf
Tomas Krizek efb3bf4
 PrivateTmp=yes
Tomas Krizek efb3bf4
 Restart=on-failure
Tomas Krizek efb3bf4
 RestartSec=60s
Tomas Krizek efb3bf4
diff --git a/install/tools/Makefile.am b/install/tools/Makefile.am
Tomas Krizek efb3bf4
index 2866a30..66ee9e3 100644
Tomas Krizek efb3bf4
--- a/install/tools/Makefile.am
Tomas Krizek efb3bf4
+++ b/install/tools/Makefile.am
Tomas Krizek efb3bf4
@@ -38,6 +38,7 @@ EXTRA_DIST =			\
Tomas Krizek efb3bf4
 
Tomas Krizek efb3bf4
 appdir = $(libexecdir)/ipa/
Tomas Krizek efb3bf4
 app_SCRIPTS =			\
Tomas Krizek efb3bf4
+	ipa-custodia		\
Tomas Krizek efb3bf4
 	ipa-httpd-kdcproxy	\
Tomas Krizek efb3bf4
 	ipa-pki-retrieve-key	\
Tomas Krizek efb3bf4
 	$(NULL)
Tomas Krizek efb3bf4
diff --git a/install/tools/ipa-custodia b/install/tools/ipa-custodia
Tomas Krizek efb3bf4
new file mode 100755
Tomas Krizek efb3bf4
index 0000000..2086a9c
Tomas Krizek efb3bf4
--- /dev/null
Tomas Krizek efb3bf4
+++ b/install/tools/ipa-custodia
Tomas Krizek efb3bf4
@@ -0,0 +1,6 @@
Tomas Krizek efb3bf4
+#!/usr/bin/python2
Tomas Krizek efb3bf4
+# Copyright (C) 2017  IPA Project Contributors, see COPYING for license
Tomas Krizek efb3bf4
+from custodia.server import main
Tomas Krizek efb3bf4
+
Tomas Krizek efb3bf4
+if __name__ == '__main__':
Tomas Krizek efb3bf4
+    main()
Tomas Krizek efb3bf4
-- 
Tomas Krizek efb3bf4
2.9.3
Tomas Krizek efb3bf4