Skip to content

Commit e2fee2f

Browse files
author
gitlab
committed
Merge branch 'ZSTAC-25975-1@@2' into 'master'
[BugFix: ZSTACK-26382] See merge request zstackio/zstack!6104
2 parents 606403e + f859a8c commit e2fee2f

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

conf/errorElaborations/Elaboration.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,30 @@
13751375
"message_cn": "找不到合适的host来启动vm, 因为该主存储的vm只能启动在host[%2$s]上,但这个host没有足够的cpu/memory/gpu资源,或不处于Enabled/Connected 状态",
13761376
"message_en": "the vm can only be started on the host[%2$s] because of its primary storage, but the host is either not having enough cpu/memory/gpu, or in the Enabled/Connected status"
13771377
},
1378+
{
1379+
"category": "VM",
1380+
"code": "1042",
1381+
"method": "regex",
1382+
"regex": "IP\\[.*] is not available on the L3 network\\[uuid:.*] because:.*it is gateway.*",
1383+
"message_cn": "在L3网络[uuid:%2$s]中,IP[%1$s]不可用, 因为IP是网关地址",
1384+
"message_en": "IP[%1$s] is not available on the L3 network[uuid:%2$s] because: it is gateway"
1385+
},
1386+
{
1387+
"category": "VM",
1388+
"code": "1043",
1389+
"method": "regex",
1390+
"regex": "IP\\[.*] is not available on the L3 network\\[uuid:.*] because:.*it is not in this range.*",
1391+
"message_cn": "在L3网络[uuid:%2$s]中,IP[%1$s]不可用, 因为IP不在网络段范围内",
1392+
"message_en": "IP[%1$s] is not available on the L3 network[uuid:%2$s] because: it is not in this range"
1393+
},
1394+
{
1395+
"category": "VM",
1396+
"code": "1044",
1397+
"method": "regex",
1398+
"regex": "IP\\[.*] is not available on the L3 network\\[uuid:.*] because:.*it is used.*",
1399+
"message_cn": "在L3网络[uuid:%2$s]中,IP[%1$s]不可用, 因为IP被占用",
1400+
"message_en": "IP[%1$s] is not available on the L3 network[uuid:%2$s] because: it is used"
1401+
},
13781402
{
13791403
"category": "VOLUME",
13801404
"code": "1000",

conf/i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5130,7 +5130,7 @@
51305130
{
51315131
"raw": "IP[%s] is not available on the L3 network[uuid:%s] because: %s",
51325132
"en_US": "IP[{0}] is not available on the L3 network[uuid:{1}] because: {2}",
5133-
"zh_CN": "在L3网络[uuid:{1}]中,IP[{0}]不可用, 因为{{2}}",
5133+
"zh_CN": "在L3网络[uuid:{1}]中,IP[{0}]不可用, 因为{2}",
51345134
"arguments": [
51355135
"ip",
51365136
"l3Uuid",

network/src/main/java/org/zstack/network/l3/L3BasicNetwork.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ protected CheckIpAvailabilityReply checkIpAvailability(String ip) {
366366
// not an IP of this L3 or is a gateway
367367
reply.setAvailable(false);
368368
if (isGateway) {
369-
reply.setReason(IpNotAvailabilityReason.GATEWAY.toi18nString());
369+
reply.setReason(IpNotAvailabilityReason.GATEWAY.toString());
370370
} else {
371-
reply.setReason(IpNotAvailabilityReason.NO_IN_RANGE.toi18nString());
371+
reply.setReason(IpNotAvailabilityReason.NO_IN_RANGE.toString());
372372
}
373373
return reply;
374374
} else {
@@ -377,7 +377,7 @@ protected CheckIpAvailabilityReply checkIpAvailability(String ip) {
377377
q.add(UsedIpVO_.ip, Op.EQ, ip);
378378
if (q.isExists()) {
379379
reply.setAvailable(false);
380-
reply.setReason(IpNotAvailabilityReason.USED.toi18nString());
380+
reply.setReason(IpNotAvailabilityReason.USED.toString());
381381
} else {
382382
reply.setAvailable(true);
383383
}

test/src/test/groovy/org/zstack/test/integration/network/l3network/IpRangeCase.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ class IpRangeCase extends SubCase {
125125
check.sessionId = adminSession()
126126
CheckIpAvailabilityAction.Result res = check.call()
127127
assert res.value.available == false
128-
assert res.value.reason == IpNotAvailabilityReason.GATEWAY.toi18nString()
128+
assert res.value.reason == IpNotAvailabilityReason.GATEWAY.toString()
129129

130130
check = new CheckIpAvailabilityAction()
131131
check.ip = "10.0.1.2"
132132
check.l3NetworkUuid = l3_3.getUuid()
133133
check.sessionId = adminSession()
134134
res = check.call()
135135
assert res.value.available == false
136-
assert res.value.reason == IpNotAvailabilityReason.NO_IN_RANGE.toi18nString()
136+
assert res.value.reason == IpNotAvailabilityReason.NO_IN_RANGE.toString()
137137

138138
check = new CheckIpAvailabilityAction()
139139
check.ip = "10.0.1.120"
@@ -156,7 +156,7 @@ class IpRangeCase extends SubCase {
156156
check.sessionId = adminSession()
157157
res = check.call()
158158
assert res.value.available == false
159-
assert res.value.reason == IpNotAvailabilityReason.USED.toi18nString()
159+
assert res.value.reason == IpNotAvailabilityReason.USED.toString()
160160

161161
L3NetworkInventory l3_4 = createL3Network {
162162
name = "l3-4"

0 commit comments

Comments
 (0)