mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-28 20:06:05 +00:00
fix: Guest IP was not retrieved correctly (#1229)
This commit is contained in:
+14
-1
@@ -87,7 +87,20 @@ readGuestPort() {
|
||||
|
||||
readGuestIp() {
|
||||
|
||||
ip=$(readJsonField '.data.data.ip.data[] | select(has("ip")) | .ip | select(test("^[0-9]+\\."))' | head -n 1) || return 1
|
||||
ip=$(readJsonField '
|
||||
first(
|
||||
.data.data.ip.data[] |
|
||||
select(.name=="eth0" and has("ip")) |
|
||||
.ip |
|
||||
select(test("^[0-9]+\\."))
|
||||
) // first(
|
||||
.data.data.ip.data[] |
|
||||
select(has("ip")) |
|
||||
.ip |
|
||||
select(test("^[0-9]+\\."))
|
||||
)
|
||||
') || return 1
|
||||
|
||||
[ -z "$ip" ] && return 1
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user