bug 816
modify ri_func_dep.py after review
This commit is contained in:
@@ -3,27 +3,27 @@
|
||||
import ri_data
|
||||
|
||||
class Pkg():
|
||||
pkg_list = []
|
||||
list = []
|
||||
|
||||
@staticmethod
|
||||
def set_pkg_list ():
|
||||
def set_list ():
|
||||
for i in ri_data.Group.dict.values():
|
||||
if i.install != 'no':
|
||||
Pkg.pkg_list += i.mandatory
|
||||
Pkg.list += i.mandatory
|
||||
if i.selection == 'all':
|
||||
Pkg.pkg_list += [ j[0] for j in i.optional ]
|
||||
Pkg.list += [ j[0] for j in i.optional ]
|
||||
else:
|
||||
Pkg.pkg_list += [ j[0] for j in i.optional if j[1] == 'yes' ]
|
||||
Pkg.list += [ j[0] for j in i.optional if j[1] == 'yes' ]
|
||||
|
||||
class FsType():
|
||||
mp_fstype_list = []
|
||||
list = []
|
||||
|
||||
@staticmethod
|
||||
def set_mp_fstype_list ():
|
||||
def set_list ():
|
||||
for fs in ri_data.MountPoint.list:
|
||||
FsType.mp_fstype_list.append(fs.filesystem)
|
||||
FsType.list.append(fs.filesystem)
|
||||
|
||||
class FunctionDepending:
|
||||
class FunctionDepending():
|
||||
list = []
|
||||
def __init__(self, pkg):
|
||||
self.package = pkg
|
||||
@@ -37,13 +37,13 @@ class FunctionDepending:
|
||||
|
||||
|
||||
class FileSystem(FunctionDepending):
|
||||
mp_fstype_list = []
|
||||
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.mp_fstype_list and self.package not in Pkg.pkg_list:
|
||||
if self.filesystem_type in FsType.list and self.package not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -56,7 +56,7 @@ class DHCP(FunctionDepending):
|
||||
FunctionDepending.__init__(self, 'dhcpcd')
|
||||
|
||||
def check(self):
|
||||
if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.pkg_list:
|
||||
if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -68,7 +68,7 @@ class RAID(FunctionDepending):
|
||||
FunctionDepending.__init__(self, 'mdadm')
|
||||
|
||||
def check(self):
|
||||
if 'mdadm' not in Pkg.pkg_list:
|
||||
if 'mdadm' not in Pkg.list:
|
||||
for i in ri_data.Raid.list:
|
||||
if i.from_os == 'no':
|
||||
return False
|
||||
@@ -79,8 +79,8 @@ class RAID(FunctionDepending):
|
||||
|
||||
def check_function_depending():
|
||||
|
||||
Pkg.set_pkg_list()
|
||||
FsType.set_mp_fstype_list()
|
||||
Pkg.set_list()
|
||||
FsType.set_list()
|
||||
func_dep_dict = {}
|
||||
|
||||
FileSystem("xfs", "xfsprogs")
|
||||
@@ -96,5 +96,4 @@ def check_function_depending():
|
||||
func_dep_dict.update(tmp)
|
||||
return func_dep_dict
|
||||
|
||||
#check_function_depending()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user