Alon Bar-Lev has uploaded a new change for review. Change subject: BZ#849542 bootstrap: acquire time for host immediately before send ......................................................................
BZ#849542 bootstrap: acquire time for host immediately before send Engine uses its own clock to send current time to host during bootstrap. This change moves the point in which clock is sampled immediately before bootstrap command is sent, as result we have smaller clock delta. Signed-off-by: Alon Bar-Lev <alo...@redhat.com> Change-Id: I37a6f961eecb392e0e31eeab459fbd9229e42df6 --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/81/7381/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java index e2cafda..511542f 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java @@ -167,9 +167,6 @@ Config.<Boolean> GetValue(ConfigValues.UseSecureConnectionWithServers).toString()); initialCommand = initialCommand.replace("{OrganizationName}", HandleOrganizationNameString(Config.<String> GetValue(ConfigValues.OrganizationName))); - DateTime utcNow = DateTime.getUtcNow(); - serverInstallationTime = utcNow.toString("yyyy-MM-ddTHH:mm:ss"); - initialCommand = initialCommand.replace("{utc_time}", serverInstallationTime); initialCommand = initialCommand.replace("{management_port}", (Integer.toString(vds.getport()))); String publicUrlPort = Config.<String> GetValue(ConfigValues.PublicURLPort); @@ -188,9 +185,18 @@ private boolean runBootstrapCommand(boolean doFinal) { boolean fRes = false; String command = _bootstrapCommand.replace("{RunFlag}", doFinal ? "True" : "False"); - if (doFinal && !_rebootAfterInstallation) { - command = command.replace(" -b ", " "); + if (!doFinal) { + serverInstallationTime = DateTime.getUtcNow().toString("yyyy-MM-ddTHH:mm:ss"); } + else { + if (!_rebootAfterInstallation) { + command = command.replace(" -b ", " "); + } + } + + // NOTICE: the time is also used as ticket for registration + // time will be correct only at !doFinal + command = command.replace("{utc_time}", serverInstallationTime); log.infoFormat( "Installation of {0}. Sending SSH Command {1} < {2}. (Stage: {3})", -- To view, visit http://gerrit.ovirt.org/7381 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37a6f961eecb392e0e31eeab459fbd9229e42df6 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches