Исправление передачи аргументов
This commit is contained in:
parent
7c397e4245
commit
8ce90f44b7
@ -11,14 +11,6 @@ ndb = NDB()
|
|||||||
|
|
||||||
|
|
||||||
def network_config(ip, mask, gateway):
|
def network_config(ip, mask, gateway):
|
||||||
# ip = IPRoute()
|
|
||||||
# index = ip.link_lookup(ifname='em1')[0]
|
|
||||||
# ip.addr('add', index, address='192.168.0.1', mask=24)
|
|
||||||
# ip.close()
|
|
||||||
# ip = IPDB()
|
|
||||||
# with ip.interfaces.br0 as br0:
|
|
||||||
# em1.add_ip('{ip}/{mask}'.format(ip=ip, mask=mask))
|
|
||||||
# ip.release()
|
|
||||||
with ndb.interfaces['br0'] as br0:
|
with ndb.interfaces['br0'] as br0:
|
||||||
address = '{ip}/{mask}'.format(ip=ip, mask=mask)
|
address = '{ip}/{mask}'.format(ip=ip, mask=mask)
|
||||||
br0.add_ip(address).commit()
|
br0.add_ip(address).commit()
|
||||||
@ -27,14 +19,11 @@ def network_config(ip, mask, gateway):
|
|||||||
|
|
||||||
|
|
||||||
def TestApp(*args):
|
def TestApp(*args):
|
||||||
# These lines create the form and populate it with widgets.
|
NetworkView = npyscreen.ActionForm(name = "SaaS",)
|
||||||
# A fairly complex screen in only 8 or so lines of code - a line for each control.
|
ip = NetworkView.add(npyscreen.TitleText, name = "IP:",)
|
||||||
NetworkView = npyscreen.ActionForm(name = "SaaS",)
|
mask = NetworkView.add(npyscreen.TitleText, name = "Netmask:",)
|
||||||
ip = NetworkView.add(npyscreen.TitleText, name = "IP:",)
|
gateway = NetworkView.add(npyscreen.TitleText, name = "Gateway:",)
|
||||||
mask = NetworkView.add(npyscreen.TitleText, name = "Netmask:",)
|
|
||||||
gateway = NetworkView.add(npyscreen.TitleText, name = "Gateway:",)
|
|
||||||
|
|
||||||
# This lets the user interact with the Form.
|
|
||||||
NetworkView.edit()
|
NetworkView.edit()
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user