Skip to content

Commit

Permalink
BEE-52312 - SuggestedChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarciacloudbees committed Nov 12, 2024
1 parent d5d3cba commit a1700c5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/hudson/slaves/CommandLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ public CommandLauncher(String command) throws Descriptor.FormException {
* @param env environment variables for the launcher to include when it runs the command
*/
public CommandLauncher(String command, EnvVars env) {
try {
checkSandbox();
} catch (Descriptor.FormException ex) {
throw new RuntimeException(ex);
}

this.agentCommand = command;
this.env = env;
ScriptApproval.get().preapprove(command, SystemCommandLanguage.get());
Expand Down Expand Up @@ -305,11 +299,12 @@ public boolean filterType(@NonNull Class<?> contextClass, @NonNull Descriptor de
}

private boolean isCreatingNewObject() {
if (Stapler.getCurrentRequest() != null) {
List<Ancestor> ancs = Stapler.getCurrentRequest().getAncestors();
var req = Stapler.getCurrentRequest();
if (req != null) {

Check warning on line 303 in src/main/java/hudson/slaves/CommandLauncher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 303 is only partially covered, one branch is missing
List<Ancestor> ancs = req.getAncestors();
for (Ancestor anc : ancs) {
if (anc.getObject() instanceof ComputerSet) {
String uri = Stapler.getCurrentRequest().getOriginalRequestURI();
String uri = req.getOriginalRequestURI();
if (uri.endsWith("createItem")) {
return true;
}
Expand Down

0 comments on commit a1700c5

Please sign in to comment.