Add ability specify ip without specify interface.

lvmraid
Mike Hiretsky 13 years ago
parent 665f952a25
commit 4b1e7dd5b4

@ -1186,6 +1186,12 @@ class cl_install(color_print, SignalInterrupt):
# check interfaces
getVar = self.clVars.Get
interfaces = getVar('os_install_net_interfaces')
if interfaces:
defaultIface = interfaces[0]
else:
defaultIface = ""
ipaddrs = map(lambda x: x if len(x)==2 else (defaultIface,x[0]),
ipaddrs)
specifiedIface = dhcps + map(lambda x:x[0],ipaddrs)
routeIface = filter(lambda x:x,
map(lambda x:x[2],filter(lambda x:len(x)>2,routes)))

@ -105,7 +105,7 @@ CMD_OPTIONS = [{'shortOption':"d",
'help':_("get ip address by %s for specified interface")%"DHCP"
},
{'longOption':"ip",
'optVal':"IFACE:IP",
'optVal':"[IFACE:]IP",
'action':'append',
'help':_("ip address with net (example:%s)")%"192.168.1.1/24"
},
@ -223,7 +223,7 @@ class install_cmd(share_cmd):
self.optobj.error(errMsg)
if values.ip:
for ipaddr in values.ip:
if not re.match("^\w+:%s$"%iputils.IP_ADDR_NET,ipaddr):
if not re.match("^(\w+:)?%s$"%iputils.IP_ADDR_NET,ipaddr):
self.optobj.error(_("option %s:") %"--ip" +\
" " + _("ip specifing error: '{ip}' "
"(example: '{example}')").format(\

Loading…
Cancel
Save