backend/server/rhnServer/server_kickstart.py | 14 ++++++++++
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 11 -------
java/code/src/com/redhat/rhn/manager/kickstart/KickstartSessionCreateCommand.java | 5 +--
3 files changed, 17 insertions(+), 13 deletions(-)
New commits:
commit 197126b6b6aaeac65c51253523a5180d08361e9d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Oct 27 14:07:42 2011 +0200
600527 - during kickstart, check if at least one activation key allows config files to be deployed upon registration.
diff --git a/backend/server/rhnServer/server_kickstart.py b/backend/server/rhnServer/server_kickstart.py
index 91be103..b878032 100644
--- a/backend/server/rhnServer/server_kickstart.py
+++ b/backend/server/rhnServer/server_kickstart.py
@@ -349,6 +349,20 @@ def schedule_config_deploy(server_id, action_id, kickstart_session_id,
else:
aid = action_id
+ tokens_obj = rhnFlags.get("registration_token")
+ if not tokens_obj:
+ log_debug(3, "Failed to get the registration_token")
+ return aid
+ else:
+ tokens_obj = rhnFlags.get("registration_token")
+ deployment = false
+ for token in tokens_obj.tokens:
+ if token['deploy_configs'] == 'Y':
+ deployment = true
+ break
+ if not deployment:
+ return aid
+
next_action_id = rhnAction.schedule_server_action(
server_id,
action_type='configfiles.deploy',
commit 0e4e633f225466f45cb48d2d6db3458c135d1c76
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 25 16:55:58 2011 +0200
600527 - for kickstart session (re)activation keys, always set the deployConfigs to false.
After a change for bug 557581, only one activation key with
rhnregtoken.deploy_configs set to Y is enough for configuration to
start deploying. We need to give the user a chance to check the
Configuration File Deployment
in user activation key explicitly.
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index 4278e89..5ccd2ab 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -684,12 +684,6 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
note = "Automatically generated activation key.";
}
- boolean cfgMgmtFlag =
- this.getKsdata()
- .getKickstartDefaults()
- .getCfgManagementFlag()
- .booleanValue();
-
RegistrationType regType = getKsdata().getRegistrationType(user);
if (regType.equals(RegistrationType.REACTIVATION)) {
@@ -698,7 +692,6 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
this.ksdata,
RegistrationType.REACTIVATION.equals(regType) ? getTargetServer() : null,
this.kickstartSession,
- cfgMgmtFlag,
1L,
note);
}
@@ -853,7 +846,6 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
* @param ksdata associated with the key
* @param server being kickstarted (can be null)
* @param session associated with the kickstart (NOT NULL)
- * @param deployConfigs if you want to or not
* @param note to add to key
* @param usageLimit to apply to the key. null for unlimited.
* @return ActivationKey that has been saved to the DB.
@@ -862,7 +854,6 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
KickstartData ksdata,
Server server,
KickstartSession session,
- boolean deployConfigs,
Long usageLimit,
String note) {
@@ -870,7 +861,7 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
ActivationKey key = ActivationKeyManager.getInstance().
createNewReActivationKey(creator, server, note, session);
key.addEntitlement(ServerConstants.getServerGroupTypeProvisioningEntitled());
- key.setDeployConfigs(deployConfigs);
+ key.setDeployConfigs(false);
key.setUsageLimit(usageLimit);
if (KickstartVirtualizationType.paraHost().
equals(ksdata.getKickstartDefaults().getVirtualizationType())) {
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartSessionCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartSessionCreateCommand.java
index 7b0e909..22022a5 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartSessionCreateCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartSessionCreateCommand.java
@@ -27,7 +27,6 @@ import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.manager.profile.ProfileManager;
-import org.apache.commons.lang.BooleanUtils;
import org.apache.log4j.Logger;
import java.util.Date;
@@ -94,8 +93,8 @@ public class KickstartSessionCreateCommand {
log.debug("creating one-time-activation key: " + user.getLogin());
ActivationKey key = KickstartScheduleCommand.createKickstartActivationKey(user,
ksdata, null,
- this.ksession, BooleanUtils.toBoolean(
- ksdata.getKickstartDefaults().getCfgManagementFlag()), null, note);
+ this.ksession,
+ null, note);
log.debug("added key: " + key.getKey());
// Need to add child channels to the key so when kickstarting the