java/conf/cobbler/snippets/post_reactivation_key | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 3b72ce18cb12ecf446a86cc82a7e0f3926adbb76 Author: Justin Sherrill jsherril@redhat.com Date: Fri Jul 30 17:37:49 2010 -0400
619381 - fixing issue where reprovisioning a system would cause registration to fail in the %post section resulting in the system not being registered at all.
The cause was that we were obtaining a re-activation key regardless of whether or not a reactivation key was already being used within the kickstart(Which would invalidate the one already present). The little bit of code that i added will go through all activation keys of the kickstart and if one is a reactivation key, will not try to obtain a new one.
diff --git a/java/conf/cobbler/snippets/post_reactivation_key b/java/conf/cobbler/snippets/post_reactivation_key index df38e4a..9b7a972 100644 --- a/java/conf/cobbler/snippets/post_reactivation_key +++ b/java/conf/cobbler/snippets/post_reactivation_key @@ -1,8 +1,14 @@ %post --interpreter /usr/bin/python import xmlrpclib +import os import os.path system_id = "/root/systemid.old" try: + + new_keys = "$redhat_management_key" + for key in new_keys.split(','): + if key.startswith('re-'): + os.exit(0) if os.path.exists(system_id): client = xmlrpclib.Server("http://$http_server/rpc/api") key = client.system.obtain_reactivation_key(open(system_id).read())
spacewalk-commits@lists.fedorahosted.org