-
Notifications
You must be signed in to change notification settings - Fork 332
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
upgrade: Run configuration upgrade under empty ccache collection #1725
Conversation
ipaserver/install/server/upgrade.py
Outdated
os.environ['KRB5CCNAME'] = old_path | ||
else: | ||
del os.environ['KRB5CCNAME'] | ||
for f in os.listdir(kpath_dir): |
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.
Use shutil.rmtree()
, it removes the directory and all its children.
ipaserver/install/server/upgrade.py
Outdated
# Bug https://bugzilla.redhat.com/show_bug.cgi?id=1558818 | ||
kpath_dir = tempfile.mkdtemp(prefix="upgrade_ccaches", | ||
dir=paths.IPA_CCACHES) | ||
kpath = "DIR:{dir}s".format(dir=kpath_dir) |
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.
The extra s
after the directory name looks like a mistake.
kpath = "DIR:{}".format(kpath)
is shorter and easier to read.
9335783
to
137ac89
Compare
Use temporary empty DIR-based ccache collection to prevent upgrade failures in case KCM: or KEYRING: ccache type is used by default in krb5.conf and is not available. We don't need any user credentials during upgrade procedure but kadmin.local would attempt to resolve default ccache and if that's not available, kadmin.local will fail. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1558818 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
137ac89
to
d2945b6
Compare
Updated to use shutil.rmtree() and simplify the formatting. |
Thanks, LGTM to me! |
Hi @abbra
|
master:
|
Use temporary empty DIR-based ccache collection to prevent upgrade
failures in case KCM: or KEYRING: ccache type is used by default in
krb5.conf and is not available. We don't need any user credentials
during upgrade procedure but kadmin.local would attempt to resolve
default ccache and if that's not available, kadmin.local will fail.
This approach was successfully tested with OpenQA tests that upgrade from F27 to F28.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1558818