Permalink
Browse files

Transfer customization task files before propagate as well

In 19a8658, we moved customization task
file transfer from propagate to start in order to support customization
of virtual machines without propagation.

However, this file transfer mechanism is also used to copy certificates
needed for HTTPS propagation.

This commit brings back the file transfer before propagate while keeping
it before start as well.  While this means files are sent twice to VMM
nodes, this is not a big issue since those files are generally very
small.

Eventually, this could be fixed by specifying at which stage each
file should be transferred.
  • Loading branch information...
1 parent 621b9bb commit 38e8f871183a7fd92875c2795036fa7fcfa8f543 @priteau priteau committed Aug 15, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 service/service/java/source/src/org/globus/workspace/xen/xenssh/Propagate.java
View
30 service/service/java/source/src/org/globus/workspace/xen/xenssh/Propagate.java
@@ -16,12 +16,15 @@
package org.globus.workspace.xen.xenssh;
+import org.globus.workspace.PathConfigs;
import org.globus.workspace.WorkspaceException;
import org.globus.workspace.cmdutils.SSHUtil;
import org.globus.workspace.persistence.WorkspaceDatabaseException;
+import org.globus.workspace.service.binding.vm.FileCopyNeed;
import org.globus.workspace.service.binding.vm.VirtualMachine;
import org.globus.workspace.service.impls.site.PropagationAdapter;
import org.globus.workspace.xen.XenTask;
+import org.globus.workspace.xen.XenUtil;
import java.util.ArrayList;
@@ -55,12 +58,39 @@ protected void init() throws WorkspaceException {
protected Exception preExecute(boolean fake) {
+ final boolean eventLog = this.ctx.lager().eventLog;
final boolean traceLog = this.ctx.lager().traceLog;
if (traceLog) {
logger.trace("Beginning propagate pre-execute");
}
+ // init would have thrown exception if null
+ final VirtualMachine vm = this.ctx.getVm();
+
+ final FileCopyNeed[] needs = vm.getFileCopyNeeds();
+ if (needs == null || needs.length == 0) {
+ if (traceLog) {
+ logger.debug("FileCopy push: nothing to do");
+ }
+ return null;
+ }
+
+ final PathConfigs paths = this.ctx.getLocator().getPathConfigs();
+ final String backendDirectory = paths.getBackendTempDirPath();
+ final String localDirectory = paths.getLocalTempDirPath();
+
+ try {
+ XenUtil.doFilePushRemoteTarget(vm,
+ localDirectory,
+ backendDirectory,
+ fake,
+ eventLog,
+ traceLog);
+ } catch (Exception e) {
+ return e;
+ }
+
return _preExecute(fake,
this.ctx.getLocator().getPropagationAdapter());
}

0 comments on commit 38e8f87

Please sign in to comment.