mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
linstor: use relative hostname path (#8633)
As described in issue #8310 some older distributions don't have hostname in /usr/bin so rely on PATH resolving
This commit is contained in:
parent
2729ee110e
commit
393f3d7727
@ -72,7 +72,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
|
|||||||
|
|
||||||
private String getHostname() {
|
private String getHostname() {
|
||||||
// either there is already some function for that in the agent or a better way.
|
// either there is already some function for that in the agent or a better way.
|
||||||
ProcessBuilder pb = new ProcessBuilder("/usr/bin/hostname");
|
ProcessBuilder pb = new ProcessBuilder("hostname");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
@ -88,7 +88,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
|
|||||||
return result.trim();
|
return result.trim();
|
||||||
} catch (IOException | InterruptedException exc) {
|
} catch (IOException | InterruptedException exc) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
throw new CloudRuntimeException("Unable to run '/usr/bin/hostname' command.");
|
throw new CloudRuntimeException("Unable to run 'hostname' command.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user