fix: fail to create network in default vpc

This commit is contained in:
Qiu Jian
2019-05-06 20:59:35 +08:00
parent eaa183a8de
commit ea469991e5
+2 -2
View File
@@ -550,8 +550,8 @@ func (self *SVpc) StartDeleteVpcTask(ctx context.Context, userCred mcclient.Toke
}
func (self *SVpc) getPrefix() []netutils.IPV4Prefix {
ret := []netutils.IPV4Prefix{}
if len(self.CidrBlock) > 0 {
ret := []netutils.IPV4Prefix{}
blocks := strings.Split(self.CidrBlock, ",")
for _, block := range blocks {
prefix, _ := netutils.NewIPV4Prefix(block)
@@ -559,7 +559,7 @@ func (self *SVpc) getPrefix() []netutils.IPV4Prefix {
}
return ret
}
return ret
return []netutils.IPV4Prefix{{}}
}
func (self *SVpc) getIPRanges() []netutils.IPV4AddrRange {