modified: ri_cmd.py
modified: ri_data.py
modified: ../xml/interface.xml
add check network hostname ip netmask DNS.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
import ri_widget
|
||||
import os
|
||||
import ri_tk
|
||||
from ri_data import Network
|
||||
from ri_tk_cmd import network_quit as network_update
|
||||
|
||||
def quit():
|
||||
''' correspond to quit button '''
|
||||
@@ -28,6 +30,10 @@ def previous():
|
||||
def next():
|
||||
''' correspond to next button '''
|
||||
q, t = ri_widget.Sequence.current()
|
||||
|
||||
if not check_date(t):
|
||||
return
|
||||
|
||||
wid_name = ri_widget.Sequence.next()
|
||||
if wid_name is not None:
|
||||
ri_widget.Widget.dict[t].hide()
|
||||
@@ -37,6 +43,17 @@ def next():
|
||||
code = ri_widget.MessageBox.dict["next"].show()
|
||||
if code == True:
|
||||
os.execl('/usr/bin/python','python','ri_install.py', "-d","tk","-l",ri_tk.language)
|
||||
from ri_tk_cmd import *
|
||||
|
||||
|
||||
def check_date(operate):
|
||||
'''check date '''
|
||||
if operate == "network" :
|
||||
network_update()
|
||||
if not Network.hostname:
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
return False
|
||||
if Network.configuration == "static" and not Network.check_ip() :
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
return False
|
||||
return True
|
||||
|
||||
from ri_tk_cmd import *
|
||||
|
||||
@@ -450,6 +450,13 @@ p_node - xml node (parent node)'''
|
||||
to_xml_attr(doc, ntwk, Network, nm)
|
||||
p_node.appendChild(ntwk)
|
||||
|
||||
@staticmethod
|
||||
def check_ip() :
|
||||
"""check network ip"""
|
||||
if Network.ip and Network.mask and Network.gateway and Network.primary_dns:
|
||||
return True
|
||||
return False
|
||||
|
||||
class Group:
|
||||
''' software package group '''
|
||||
dict = {}
|
||||
|
||||
Reference in New Issue
Block a user