add support for FusionOS platform

This commit is contained in:
junhangis
2022-08-27 10:55:55 +08:00
parent dd319b962d
commit 3c6a24a304
14 changed files with 58 additions and 27 deletions

View File

@ -592,7 +592,7 @@ class DefaultValue():
NetWorkConfFile = ""
distname, version, idnum = LinuxDistro.linux_distribution()
distname = distname.lower()
if (distname in ("redhat", "centos", "euleros", "openEuler")):
if (distname in ("redhat", "centos", "euleros", "openEuler", "fusionos")):
NetWorkConfFile = "%s/ifcfg-%s" % (RedHatNetWorkConfPath,
networkCardNum)
else:
@ -601,7 +601,7 @@ class DefaultValue():
if (not os.path.exists(NetWorkConfFile)):
if (distname in (
"redhat", "centos", "euleros", "openeuler")):
"redhat", "centos", "euleros", "openeuler", "fusionos")):
cmd = "find %s -iname 'ifcfg-*-%s' -print" % (
RedHatNetWorkConfPath, networkCardNum)
elif (distname == "debian" and version == "buster/sid"):
@ -784,7 +784,7 @@ class DefaultValue():
"""
distname, version, _ = LinuxDistro.linux_distribution()
if (distname.lower() in ("suse", "redhat", "centos", "euleros",
"openeuler")):
"openeuler", "fusionos")):
cmd = g_file.SHELL_CMD_DICT["checkPassword"] % (checkUser,
"'^Last.*Change'")
else:
@ -805,7 +805,7 @@ class DefaultValue():
if ("password must be changed" in result):
raise Exception(ErrorCode.GAUSS_503["GAUSS_50307"])
if (distname.lower() in ("redhat", "centos", "euleros",
"openeuler")):
"openeuler", "fusionos")):
if ("password must be changed" in result):
raise Exception(ErrorCode.GAUSS_503["GAUSS_50307"])
@ -881,7 +881,7 @@ class DefaultValue():
return initSystemFile
if (distname == "SuSE" and os.path.isfile(initFileSuse)):
initFile = initFileSuse
elif (distname in ("redhat", "centos", "euleros", "openEuler") and
elif (distname in ("redhat", "centos", "euleros", "openEuler", "FusionOS") and
os.path.isfile(initFileRedhat)):
initFile = initFileRedhat
elif (distname == "debian" and version == "buster/sid" and