New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6.9 -> 7.4 migration fixes #741
Conversation
ipalib/util.py
Outdated
| @@ -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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are going to turn the cached property into a writeable and deletable property, then you can remove the complicated weakref stuff and replace it with a simple non-data descriptor:
class cachedproperty(object):
slots = ('fget',)
def __init__(self, fget):
self.fget = fget
def __get__(self, obj, objtype=None):
if obj is None:
return self
value = self.fget(obj)
setattr(obj, self.fget.__name__, value)
return value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, and add self.__doc__ = fget.__doc__.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to go with a simpler approach, pylint was a hater anyway.
|
For the record - the tests are passing on my machine, etwas stimmt hier nicht. |
| """ | ||
| if self._ca_host is not None: | ||
| return self._ca_host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that's simpler 👍
1ccd4c1
to
225fc31
Compare
|
It failed to me |
|
This was supposed to be fixed by the patch and worked for me, it seems that I may need to investigate it further. |
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 which needs to perform a set of steps against itself accessing 8443 port. This port should however only be available locally so trying to connect to remote master would fail. We need to make sure the right CA host is accessed. https://pagure.io/freeipa/issue/6878
The cachedproperty class was used in one special use-case where it only caused issues. Let's get rid of it. https://pagure.io/freeipa/issue/6878
|
Turns out I forgot to reorder the CA installation steps a bit. |
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.
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
anyway.
https://pagure.io/freeipa/issue/6878