java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java |
24 +++++++++-
java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java |
2
2 files changed, 24 insertions(+), 2 deletions(-)
New commits:
commit 96ed2076502f1c97ffa25558f46949c2c751d868
Author: Stephen Herr <sherr(a)redhat.com>
Date: Thu Aug 9 13:57:21 2012 -0400
846221 - Don't let virtual kickstarts screw up the host's cobbler id
diff --git
a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
index f9705ab..549c9a0 100644
---
a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
+++
b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java
@@ -249,6 +249,15 @@ public class CobblerSystemCreateCommand extends CobblerCommand {
*/
@Override
public ValidatorError store() {
+ return store(true);
+ }
+
+ /**
+ * Store the System to cobbler
+ * @param saveCobblerId false if CobblerVirtualSystemCommand is calling, true
otherwise
+ * @return ValidatorError if the store failed.
+ */
+ public ValidatorError store(boolean saveCobblerId) {
Profile profile = Profile.lookupByName(getCobblerConnection(), profileName);
// First lookup by MAC addr
SystemRecord rec = lookupExisting();
@@ -336,7 +345,20 @@ public class CobblerSystemCreateCommand extends CobblerCommand {
throw e;
}
}
- server.setCobblerId(rec.getId());
+
+ /*
+ * This is a band-aid for the problem revealed in bug 846221. However
+ * the real fix involves creating a new System for the virtual guest
+ * instead of re-using the host System object, and I am unsure of what
+ * effects that would have. The System object is used when creating
+ * reActivation keys and setting up the cobbler SystemRecord network
+ * info among other things. No bugs have been reported in those areas
+ * yet, so I don't want to change something that has the potential to
+ * break a lot of things.
+ */
+ if (saveCobblerId) {
+ server.setCobblerId(rec.getId());
+ }
return null;
}
/**
diff --git
a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
index 26a81ab..6ef386a 100644
---
a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
+++
b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
@@ -152,7 +152,7 @@ public class CobblerVirtualSystemCommand extends
CobblerSystemCreateCommand {
public ValidatorError store() {
ValidatorError error = null;
try {
- error = super.store();
+ error = super.store(false);
}
catch (XmlRpcException e) {
if (e.getCause() != null &&
Show replies by date