Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
import com.cloud.utils.nio.NioClient;
import com.cloud.utils.nio.NioConnection;
import com.cloud.utils.nio.Task;
import com.cloud.utils.script.OutputInterpreter;
import com.cloud.utils.script.Script;

/**
Expand Down Expand Up @@ -598,9 +597,9 @@ protected void setupStartupCommand(final StartupCommand startup) {
}

protected String getAgentArch() {
final Script command = new Script("/usr/bin/arch", 500, logger);
final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
return command.execute(parser);
String arch = Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 1000);
logger.debug("Arch for agent: {} found: {}", _name, arch);
return arch;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class KVMHostInfo {
private long reservedMemory;
private long overCommitMemory;
private List<String> capabilities = new ArrayList<>();
private static String cpuArchCommand = "/usr/bin/arch";
private static String cpuArchRetrieveExecutable = "arch";
private static List<String> cpuInfoFreqFileNames = List.of("/sys/devices/system/cpu/cpu0/cpufreq/base_frequency","/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq");

public KVMHostInfo(long reservedMemory, long overCommitMemory, long manualSpeed, int reservedCpus) {
Expand Down Expand Up @@ -248,6 +248,6 @@ private void getHostInfoFromLibvirt() {

private String getCPUArchFromCommand() {
LOGGER.info("Fetching host CPU arch");
return Script.runSimpleBashScript(cpuArchCommand);
return Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable));
return Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable), 1000);

increase timeout required here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sureshanaparti as this was already running without a timeout and I didn't face an issue here, I have not changed this

}
}
Loading