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
2 changes: 1 addition & 1 deletion systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def configure_server(self):
line = "dhcp-option=%s,26,%s" % (device, i['mtu'])
self.conf.search(sline, line)

# Netmask
# Netmask
netmask = ''
if self.config.is_vpc():
netmask = gn.get_netmask()
Expand Down
14 changes: 6 additions & 8 deletions systemvm/debian/opt/cloud/bin/cs/CsHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,20 @@ def bool_to_yn(val):
def get_device_info():
""" Returns all devices on system with their ipv4 ip netmask """
list = []
mtu = None
for i in execute("ip addr show |grep -v secondary"):
vals = i.strip().lstrip().rstrip().split()
if re.search('[0-9]:',vals[0]):
to={}
to['mtu'] = vals[4]
list.append(to)
if re.search('[0-9]:', vals[0]):
mtu = vals[4]

if vals[0] == "inet":
if len(list) > 0:
to = list.pop(len(list)-1)
else:
to={}
to = {}
to['ip'] = vals[1]
to['dev'] = vals[-1]
to['network'] = IPNetwork(to['ip'])
to['dnsmasq'] = False
if mtu:
to['mtu'] = mtu
Comment thread
weizhouapache marked this conversation as resolved.
list.append(to)
return list

Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/compute/wizard/NetworkConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default {
return Promise.resolve()
} else if (!this.ipV4Regex.test(value)) {
return Promise.reject(this.$t('message.error.ipv4.address'))
} else if (rule.networkType !== 'L2' && !this.isIp4InCidr(value, rule.cidr)) {
} else if (rule.networkType === 'Isolated' && !this.isIp4InCidr(value, rule.cidr)) {
const rangeIps = this.calculateCidrRange(rule.cidr)
const message = `${this.$t('message.error.ip.range')} ${this.$t('label.from')} ${rangeIps[0]} ${this.$t('label.to')} ${rangeIps[1]}`
return Promise.reject(message)
Expand Down