Исправление передачи аргументов

This commit is contained in:
RemiZOffAlex 2024-09-28 20:17:49 +03:00
parent 7c397e4245
commit 8ce90f44b7

View File

@ -11,14 +11,6 @@ ndb = NDB()
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:
address = '{ip}/{mask}'.format(ip=ip, mask=mask)
br0.add_ip(address).commit()
@ -27,14 +19,11 @@ def network_config(ip, mask, gateway):
def TestApp(*args):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
NetworkView = npyscreen.ActionForm(name = "SaaS",)
ip = NetworkView.add(npyscreen.TitleText, name = "IP:",)
mask = NetworkView.add(npyscreen.TitleText, name = "Netmask:",)
gateway = NetworkView.add(npyscreen.TitleText, name = "Gateway:",)
NetworkView = npyscreen.ActionForm(name = "SaaS",)
ip = NetworkView.add(npyscreen.TitleText, name = "IP:",)
mask = NetworkView.add(npyscreen.TitleText, name = "Netmask:",)
gateway = NetworkView.add(npyscreen.TitleText, name = "Gateway:",)
# This lets the user interact with the Form.
NetworkView.edit()
data = {