java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java | 11 ++++- java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java | 20 ++++++++++ java/code/src/com/redhat/rhn/domain/kickstart/KickstartInstallType.java | 11 ++++- java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java | 17 ++++++-- java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3 + java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java | 3 + java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCreateCommand.java | 2 - java/spacewalk-java.spec | 5 ++ rel-eng/packages/spacewalk-java | 2 - 9 files changed, 61 insertions(+), 13 deletions(-)
New commits: commit 17c838a719c056e0961bc62d9bfc11e64defad32 Author: Stephen Herr sherr@redhat.com Date: Tue Dec 10 16:47:55 2013 -0500
Automatic commit of package [spacewalk-java] release [2.1.93-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 943b818..0dadece 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -28,7 +28,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 2.1.92 +Version: 2.1.93 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -785,6 +785,9 @@ fi %{jardir}/postgresql-jdbc.jar
%changelog +* Tue Dec 10 2013 Stephen Herr sherr@redhat.com 2.1.93-1 +- 1039193 - Increase default ram to 768 for RHEL 7 + * Tue Dec 10 2013 Tomas Kasparek tkasparek@redhat.com 2.1.92-1 - bootstrap tuning: use new icon tag - use static code for icons map in IconTag + typo and documentation fix diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index d93ca7f..8fe0e22 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -2.1.92-1 java/ +2.1.93-1 java/
commit 009fab04141c565843e871bc705604f6a15465d2 Author: Stephen Herr sherr@redhat.com Date: Tue Dec 10 16:47:43 2013 -0500
1039193 - Increase default ram to 768 for RHEL 7
diff --git a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java index 5cd5579..46a3aa3 100644 --- a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java +++ b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java @@ -16,6 +16,8 @@ package com.redhat.rhn.common.conf;
import org.apache.commons.lang.StringUtils;
+import com.redhat.rhn.domain.kickstart.KickstartData; + import java.io.File;
/** @@ -358,10 +360,15 @@ public class ConfigDefaults { }
/** - * Returns the defualt VirtMemory Size in MBs + * Returns the default VirtMemory Size in MBs + * @param data the kickstart data, so we can tell if it's RHEL 7 * @return the memory size */ - public int getDefaultVirtMemorySize() { + public int getDefaultVirtMemorySize(KickstartData data) { + // RHEL 7 requires at least 768 MB of ram to install + if (data.isRhel7OrGreater()) { + return Config.get().getInt(VIRT_MEM, 768); + } return Config.get().getInt(VIRT_MEM, 512); }
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java index 34fba87..6eb9340 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java @@ -769,6 +769,16 @@ public class KickstartData { }
/** + * @return if this kickstart profile is rhel 7 installer type + */ + public boolean isRhel7() { + if (getInstallType() != null) { + return getInstallType().isRhel7(); + } + return false; + } + + /** * @return if this kickstart profile is rhel 5 installer type */ public boolean isRhel5() { @@ -779,6 +789,16 @@ public class KickstartData { }
/** + * @return if this kickstart profile is rhel 7 installer type or greater (for rhel8) + */ + public boolean isRhel7OrGreater() { + if (getInstallType() != null) { + return (getInstallType().isRhel7OrGreater() || getInstallType().isFedora()); + } + return false; + } + + /** * @return if this kickstart profile is rhel 6 installer type or greater (for rhel7) */ public boolean isRhel6OrGreater() { diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartInstallType.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartInstallType.java index 989e040..0c6e559 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartInstallType.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartInstallType.java @@ -40,12 +40,17 @@ public class KickstartInstallType extends BaseDomainHelper { private String name;
/** + * @return if this installer type is rhel 7 or greater (for rhel8) + */ + public boolean isRhel7OrGreater() { + return (isRhel6OrGreater() && !isRhel6()); + } + + /** * @return if this installer type is rhel 6 or greater (for rhel7) */ public boolean isRhel6OrGreater() { - // we need to reverse logic here - return (!isRhel2() && !isRhel3() && !isRhel4() && !isRhel5() && !isFedora() && - !isGeneric()); + return (isRhel5OrGreater() && !isRhel5()); }
/** diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java index abc0249..850dba5 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java @@ -157,7 +157,8 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { form.set(VIRT_BRIDGE, data.getDefaultVirtBridge()); form.set(VIRT_CPU, ConfigDefaults.get().getDefaultVirtCpus()); form.set(VIRT_DISK_SIZE, ConfigDefaults.get().getDefaultVirtDiskSize()); - form.set(VIRT_MEMORY, ConfigDefaults.get().getDefaultVirtMemorySize()); + form.set(VIRT_MEMORY, ConfigDefaults.get() + .getDefaultVirtMemorySize(data)); } else { setFormValueOrDefault(form, VIRT_BRIDGE, prof.getVirtBridge(), @@ -167,7 +168,7 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { setFormValueOrDefault(form, VIRT_DISK_SIZE, prof.getVirtFileSize(), ConfigDefaults.get().getDefaultVirtDiskSize()); setFormValueOrDefault(form, VIRT_MEMORY, prof.getVirtRam(), - ConfigDefaults.get().getDefaultVirtMemorySize()); + ConfigDefaults.get().getDefaultVirtMemorySize(data)); } ctx.getRequest().setAttribute(IS_VIRT, Boolean.TRUE); } @@ -285,9 +286,15 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { * @param ksdata the kickstart data * @param form the form * @param user the user + * @throws ValidatorException if there is not enough ram */ - public static void processCobblerFormValues(KickstartData ksdata, - DynaActionForm form, User user) { + public static void processCobblerFormValues(KickstartData ksdata, DynaActionForm form, + User user) throws ValidatorException { + int virtMemory = (Integer) form.get(VIRT_MEMORY); + if (ksdata.isRhel7OrGreater() && virtMemory < 768) { + ValidatorException.raiseException("kickstart.cobbler.profile.notenoughmemory"); + } + CobblerProfileEditCommand cmd = new CobblerProfileEditCommand(ksdata, user);
cmd.setKernelOptions(StringUtils.defaultString(form.getString(KERNEL_OPTIONS))); @@ -302,7 +309,7 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { }
if (KickstartDetailsEditAction.canSaveVirtOptions(ksdata, form)) { - prof.setVirtRam((Integer) form.get(VIRT_MEMORY)); + prof.setVirtRam(virtMemory); prof.setVirtCpus((Integer) form.get(VIRT_CPU)); prof.setVirtFileSize((Integer) form.get(VIRT_DISK_SIZE)); prof.setVirtBridge(form.getString(VIRT_BRIDGE)); diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml index 18d3753..88f9c93 100644 --- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml +++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml @@ -7640,6 +7640,9 @@ Follow this url to see the full list of inactive systems: <trans-unit id="message.crashnoteupdated"> <source>Crash Note was successfully updated.</source> </trans-unit> + <trans-unit id="kickstart.cobbler.profile.notenoughmemory"> + <source>Red Hat Enterprise Linux 7 and higher guests require at least 768 MB of memory.</source> + </trans-unit> <trans-unit id="kickstart.cobbler.profile.invalidvirt"> <source>Para-Virtualization is unsupported with the selected kickstart tree or distribution.</source> </trans-unit> diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java index b5b978b..824d662 100644 --- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java +++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java @@ -65,6 +65,9 @@ public class SelectableDecorator extends BaseListDecorator { renderSelectedCaption(false); }
+ /** + * {@inheritDoc} + */ @Override public void onFooterExtraAddons() throws JspException { renderSelectButtons(); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCreateCommand.java index 6c9d42f..9967864 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCreateCommand.java @@ -73,7 +73,7 @@ public class CobblerProfileCreateCommand extends CobblerProfileCommand { KickstartFactory.saveKickstartData(this.ksData); prof.setVirtBridge(this.ksData.getDefaultVirtBridge()); prof.setVirtCpus(ConfigDefaults.get().getDefaultVirtCpus()); - prof.setVirtRam(ConfigDefaults.get().getDefaultVirtMemorySize()); + prof.setVirtRam(ConfigDefaults.get().getDefaultVirtMemorySize(this.ksData)); prof.setVirtFileSize(ConfigDefaults.get().getDefaultVirtDiskSize()); prof.setKickstart(this.ksData.buildCobblerFileName()); prof.save();
spacewalk-commits@lists.fedorahosted.org