modified: interface/ri_data.py
modified: interface/ri_func_dep.py modified: interface/ri_inst_cli.py modified: interface/ri_inst_tk.py modified: interface/ri_oper.py modified: xml/interface.xml make tab equal 4 spaces
This commit is contained in:
@@ -3,91 +3,89 @@
|
||||
import ri_data
|
||||
|
||||
class Pkg():
|
||||
list = []
|
||||
list = []
|
||||
|
||||
@staticmethod
|
||||
def set_list ():
|
||||
list = ri_data.Group.get_install_pkgs()
|
||||
@staticmethod
|
||||
def set_list ():
|
||||
list = ri_data.Group.get_install_pkgs()
|
||||
|
||||
class FsType():
|
||||
list = []
|
||||
list = []
|
||||
|
||||
@staticmethod
|
||||
def set_list ():
|
||||
for fs in ri_data.MountPoint.dict.values():
|
||||
FsType.list.append(fs.filesystem)
|
||||
@staticmethod
|
||||
def set_list ():
|
||||
for fs in ri_data.MountPoint.dict.values():
|
||||
FsType.list.append(fs.filesystem)
|
||||
|
||||
class FunctionDepending():
|
||||
list = []
|
||||
def __init__(self, pkg):
|
||||
self.package = pkg
|
||||
FunctionDepending.list.append(self)
|
||||
|
||||
def check(self):
|
||||
return False
|
||||
list = []
|
||||
def __init__(self, pkg):
|
||||
self.package = pkg
|
||||
FunctionDepending.list.append(self)
|
||||
|
||||
def error(self):
|
||||
return {}
|
||||
def check(self):
|
||||
return False
|
||||
|
||||
def error(self):
|
||||
return {}
|
||||
|
||||
class FileSystem(FunctionDepending):
|
||||
list = []
|
||||
def __init__(self, fs_type, fs_pkg):
|
||||
self.filesystem_type = fs_type
|
||||
FunctionDepending.__init__(self, fs_pkg)
|
||||
list = []
|
||||
def __init__(self, fs_type, fs_pkg):
|
||||
self.filesystem_type = fs_type
|
||||
FunctionDepending.__init__(self, fs_pkg)
|
||||
|
||||
def check(self):
|
||||
if self.filesystem_type in FsType.list and self.package not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
|
||||
def error(self):
|
||||
mesg="format filesystem " + self.filesystem_type
|
||||
return {mesg:self.package}
|
||||
def check(self):
|
||||
if self.filesystem_type in FsType.list and self.package not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
|
||||
def error(self):
|
||||
mesg="format filesystem " + self.filesystem_type
|
||||
return {mesg:self.package}
|
||||
|
||||
class DHCP(FunctionDepending):
|
||||
def __init__(self):
|
||||
FunctionDepending.__init__(self, 'dhcpcd')
|
||||
def __init__(self):
|
||||
FunctionDepending.__init__(self, 'dhcpcd')
|
||||
|
||||
def check(self):
|
||||
if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
def check(self):
|
||||
if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
|
||||
def error(self):
|
||||
return {"dynamic configure network":"dhcpcd"}
|
||||
def error(self):
|
||||
return {"dynamic configure network":"dhcpcd"}
|
||||
|
||||
class RAID(FunctionDepending):
|
||||
def __init__(self):
|
||||
FunctionDepending.__init__(self, 'mdadm')
|
||||
|
||||
def check(self):
|
||||
if 'mdadm' not in Pkg.list:
|
||||
for i in ri_data.Raid.dict.values():
|
||||
if i.from_os == 'no':
|
||||
return False
|
||||
return True
|
||||
def __init__(self):
|
||||
FunctionDepending.__init__(self, 'mdadm')
|
||||
|
||||
def check(self):
|
||||
if 'mdadm' not in Pkg.list:
|
||||
for i in ri_data.Raid.dict.values():
|
||||
if i.from_os == 'no':
|
||||
return False
|
||||
return True
|
||||
|
||||
def error(self):
|
||||
return {"make raid":"mdadm"}
|
||||
def error(self):
|
||||
return {"make raid":"mdadm"}
|
||||
|
||||
def check_function_depending():
|
||||
Pkg.set_list()
|
||||
FsType.set_list()
|
||||
func_dep_dict = {}
|
||||
|
||||
Pkg.set_list()
|
||||
FsType.set_list()
|
||||
func_dep_dict = {}
|
||||
FileSystem("xfs", "xfsprogs")
|
||||
FileSystem("jfs", "jfsutils")
|
||||
|
||||
FileSystem("xfs", "xfsprogs")
|
||||
FileSystem("jfs", "jfsutils")
|
||||
DHCP()
|
||||
RAID()
|
||||
|
||||
DHCP()
|
||||
RAID()
|
||||
|
||||
for i in FunctionDepending.list:
|
||||
# if function depending package not in package list
|
||||
if not i.check():
|
||||
tmp = i.error()
|
||||
func_dep_dict.update(tmp)
|
||||
return func_dep_dict
|
||||
for i in FunctionDepending.list:
|
||||
# if function depending package not in package list
|
||||
if not i.check():
|
||||
tmp = i.error()
|
||||
func_dep_dict.update(tmp)
|
||||
return func_dep_dict
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user