mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[FIX] Fix not enough arguments problem
This commit is contained in:
parent
8b26744a31
commit
0451566159
@ -86,14 +86,14 @@ func NewCmdInstallStatus() cli.Command {
|
||||
for _,v:=range tasks {
|
||||
for _,vs:=range v.Status{
|
||||
if vs.Status=="start"||vs.Status=="create"{
|
||||
Status(v.ID,nil)
|
||||
Status(v.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Status(taskID,nil)
|
||||
Status(taskID)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
@ -193,7 +193,7 @@ func NewCmdInstall() cli.Command {
|
||||
// return c
|
||||
//}
|
||||
|
||||
func Status(task string,nodes []string) {
|
||||
func Status(task string) {
|
||||
taskE:=clients.NodeClient.Tasks().Get(task)
|
||||
lastState:=""
|
||||
checkFail:=0
|
||||
@ -208,10 +208,7 @@ func Status(task string,nodes []string) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
for k,v:=range status.Status{
|
||||
for _,nid:=range nodes {
|
||||
if k==nid {
|
||||
|
||||
for _,v:=range status.Status{
|
||||
if strings.Contains(v.Status, "error")||strings.Contains(v.CompleStatus,"Failure")||strings.Contains(v.CompleStatus,"Unknow") {
|
||||
checkFail+=1
|
||||
fmt.Errorf("error executing task %s",task)
|
||||
@ -247,15 +244,11 @@ func Status(task string,nodes []string) {
|
||||
if len(nextTasks) > 0 {
|
||||
fmt.Printf("next will install %v \n",nextTasks)
|
||||
for _,v:=range nextTasks{
|
||||
Status(v,nodes)
|
||||
Status(v)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
checkFail=0
|
||||
}
|
||||
@ -274,7 +267,7 @@ func Task(c *cli.Context,task string,status bool) error {
|
||||
logrus.Errorf("error exec task:%s,details %s",task,err.Error())
|
||||
return err
|
||||
}
|
||||
Status(task,nodes)
|
||||
Status(task)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user