[ Agent ] [ CMII ] - 完成工具类的代码
This commit is contained in:
@@ -353,7 +353,7 @@ func (op *AgentOsOperator) deployTestNFS(funcArgs []string) (bool, []string) {
|
||||
}
|
||||
|
||||
// 下载模板文件
|
||||
k8sNFSYamlFile := "/root/wdd/install/k8s-nfs-test.yaml"
|
||||
k8sNFSYamlFile := "/root/wdd/install/k8s-nfs-test.json"
|
||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+nfsTemplateFile, k8sNFSYamlFile)
|
||||
if !ok {
|
||||
return false, resultLog
|
||||
|
||||
@@ -1244,7 +1244,7 @@ func (op *AgentOsOperator) installNFSServerOfflineExec() (bool, []string) {
|
||||
}
|
||||
}
|
||||
|
||||
// check for version
|
||||
// check for the version
|
||||
executor, i := HardCodeCommandExecutor("grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '\"' | sed 's/ /-/g'")
|
||||
if !executor {
|
||||
return false, append(i, "[installNFSServerOfflineExec]- get offline package name suffix error !")
|
||||
|
||||
@@ -503,3 +503,17 @@ func BasicAppendNullToFile(targetFile string) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func BasicWordSpaceCompletion(source string, totalLength int) string {
|
||||
sourceLength := len(source)
|
||||
|
||||
if sourceLength >= totalLength {
|
||||
return source
|
||||
}
|
||||
|
||||
for i := 0; i < totalLength-sourceLength; i++ {
|
||||
source += " "
|
||||
}
|
||||
|
||||
return source
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user