红旗可以使用centos安装 拷贝文件做文件存在校验
This commit is contained in:
@ -874,3 +874,12 @@ class FileUtil(object):
|
||||
if status != 0:
|
||||
raise Exception(ErrorCode.GAUSS_502["GAUSS_50201"] % "log file" +
|
||||
" Directory:%s." % user_dir + " Error: \n%s" % file_output)
|
||||
|
||||
@staticmethod
|
||||
def checkFileExists(file):
|
||||
"""
|
||||
function : change file exists
|
||||
input : file name
|
||||
output: NA
|
||||
"""
|
||||
return os.path.exists(file)
|
||||
|
@ -2328,16 +2328,21 @@ def copyCerts():
|
||||
oldOmSslCerts = os.path.join(g_opts.oldClusterAppPath, "share/sslcert/om")
|
||||
newOmSslCerts = os.path.join(g_opts.newClusterAppPath, "share/sslcert/om")
|
||||
|
||||
if FileUtil.checkFileExists("%s/server.key.cipher" % oldBinPath):
|
||||
FileUtil.cpFile("%s/server.key.cipher" % oldBinPath, "%s/" % newBinPath)
|
||||
FileUtil.changeMode(DefaultValue.KEY_FILE_MODE, "%s/server.key.cipher" %
|
||||
newBinPath)
|
||||
|
||||
if FileUtil.checkFileExists("%s/server.key.rand" % oldBinPath):
|
||||
FileUtil.cpFile("%s/server.key.rand" % oldBinPath, "%s/" % newBinPath)
|
||||
FileUtil.changeMode(DefaultValue.KEY_FILE_MODE, "%s/server.key.rand" %
|
||||
newBinPath)
|
||||
|
||||
for certFile in DefaultValue.SERVER_CERT_LIST:
|
||||
if FileUtil.checkFileExists("%s/%s" % (oldOmSslCerts, certFile)):
|
||||
FileUtil.cpFile("%s/%s" % (oldOmSslCerts, certFile), "%s/" %
|
||||
newOmSslCerts)
|
||||
|
||||
FileUtil.changeMode(DefaultValue.KEY_FILE_MODE, "%s/server.key.cipher" %
|
||||
newBinPath)
|
||||
FileUtil.changeMode(DefaultValue.KEY_FILE_MODE, "%s/server.key.rand" %
|
||||
newBinPath)
|
||||
FileUtil.changeMode(DefaultValue.KEY_FILE_MODE, "%s/*" %
|
||||
newOmSslCerts)
|
||||
|
||||
|
@ -183,6 +183,11 @@ class LinuxPlatform(object):
|
||||
"%s-%s-%s-%s.%s" % (
|
||||
prefix_str, packageVersion, PAK_ASIANUX,
|
||||
BIT_VERSION, postfix_str))
|
||||
if not os.path.exists(os.path.normpath(file_name)):
|
||||
file_name = os.path.join(dir_name, "./../../",
|
||||
"%s-%s-%s-%s.%s" % (
|
||||
prefix_str, packageVersion, PAK_CENTOS,
|
||||
BIT_VERSION, postfix_str))
|
||||
elif distname == SUSE and version.split('.')[0] in ("11", "12"):
|
||||
file_name = os.path.join(dir_name, "./../../",
|
||||
"%s-%s-%s-%s.%s" % (
|
||||
|
Reference in New Issue
Block a user