URL: https://github.com/freeipa/freeipa/pull/741
Author: stlaz
 Title: #741: 6.9 -> 7.4 migration fixes
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/741/head:pr741
git checkout pr741
From 84f049e2dc5e617b4f49c0e079640bd2ca76c288 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Thu, 27 Apr 2017 12:38:19 +0200
Subject: [PATCH 1/2] Allow rewriting of cached properties

Cached property should not be treated anyway special from a normal
property. If we need to rewrite/remove it, we should be able to do
just so.

 ipalib/util.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ipalib/util.py b/ipalib/util.py
index e9d4105..b9206eb 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -520,10 +520,8 @@ def __get__(self, obj, cls):
         return self.store[obj]
     def __set__(self, obj, value):
-        raise AttributeError("can't set attribute")
+        self.store[obj] = value
-    def __delete__(self, obj):
-        raise AttributeError("can't delete attribute")
 # regexp matching signed floating point number (group 1) followed by
 # optional whitespace followed by time unit, e.g. day, hour (group 7)

From ff579bb9f613d375faae62e2508a876052fa61fb Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Thu, 27 Apr 2017 12:51:30 +0200
Subject: [PATCH 2/2] Refresh Dogtag RestClient.ca_host property

Refresh the ca_host property of the Dogtag's RestClient class when
it's requested as a context manager.

This solves the problem which would occur on DL0 when installing
CA against an old master which does not have port 8443 accessible.
The setup tries to update the cert profiles via this port but
fail. This operation should be performed against the local instance

 ipaserver/plugins/dogtag.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 3997531..48dc6b3 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -1278,6 +1278,10 @@ def __enter__(self):
         """Log into the REST API"""
         if self.cookie is not None:
+        if not host_has_service(api.env.ca_host, self.api.Backend.ldap2, "CA"):
+            self.ca_host = api.env.ca_host
         status, resp_headers, _resp_body = dogtag.https_request(
             self.ca_host, self.override_port or self.env.ca_agent_port,
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to