java/conf/cobbler/snippets/post_reactivation_key | 6 ++++++
1 file changed, 6 insertions(+)
Author: Justin Sherrill <jsherril(a)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
index df38e4a..9b7a972 100644
@@ -1,8 +1,14 @@
%post --interpreter /usr/bin/python
system_id = "/root/systemid.old"
+ new_keys = "$redhat_management_key"
+ for key in new_keys.split(','):
+ if key.startswith('re-'):
client = xmlrpclib.Server("http://$http_server/rpc/api")
key = client.system.obtain_reactivation_key(open(system_id).read())