added ability to run scripts literally

This commit is contained in:
Adrian Cole 2013-01-01 17:09:51 -08:00
parent f81a0bc016
commit 79334201bf
2 changed files with 15 additions and 3 deletions

View File

@ -349,6 +349,9 @@ public interface ComputeService {
* @see org.jclouds.compute.predicates.NodePredicates#runningInGroup(String)
* @see org.jclouds.scriptbuilder.domain.Statements
*/
@Beta
ListenableFuture<ExecResponse> submitScriptOnNode(String id, String runScript, RunScriptOptions options);
@Beta
ListenableFuture<ExecResponse> submitScriptOnNode(String id, Statement runScript, RunScriptOptions options);
@ -377,4 +380,5 @@ public interface ComputeService {
@Beta
Optional<ImageExtension> getImageExtension();
}

View File

@ -512,7 +512,7 @@ public class BaseComputeService implements ComputeService {
@Override
public Map<NodeMetadata, ExecResponse> runScriptOnNodesMatching(Predicate<NodeMetadata> filter, String runScript)
throws RunScriptOnNodesException {
return runScriptOnNodesMatching(filter, Statements.exec(checkNotNull(runScript, "runScript")));
return runScriptOnNodesMatching(filter, Statements.literal(checkNotNull(runScript, "runScript")));
}
/**
@ -527,7 +527,7 @@ public class BaseComputeService implements ComputeService {
@Override
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(Predicate<NodeMetadata> filter,
String runScript, RunScriptOptions options) throws RunScriptOnNodesException {
return runScriptOnNodesMatching(filter, Statements.exec(checkNotNull(runScript, "runScript")), options);
return runScriptOnNodesMatching(filter, Statements.literal(checkNotNull(runScript, "runScript")), options);
}
/**
@ -585,7 +585,7 @@ public class BaseComputeService implements ComputeService {
*/
@Override
public ExecResponse runScriptOnNode(String id, String runScript, RunScriptOptions options) {
return runScriptOnNode(id, Statements.exec(checkNotNull(runScript, "runScript")), options);
return runScriptOnNode(id, Statements.literal(checkNotNull(runScript, "runScript")), options);
}
/**
@ -614,6 +614,14 @@ public class BaseComputeService implements ComputeService {
return response;
}
/**
* {@inheritDoc}
*/
@Override
public ListenableFuture<ExecResponse> submitScriptOnNode(String id, String runScript, RunScriptOptions options) {
return submitScriptOnNode(id, Statements.literal(checkNotNull(runScript, "runScript")), options);
}
/**
* {@inheritDoc}
*/