mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 03:37:46 +08:00
[REV] optimize basic output,remove wrong json
This commit is contained in:
parent
2702cfc3f8
commit
c11cecf1d2
@ -28,7 +28,6 @@ import (
|
||||
"github.com/goodrain/rainbond/pkg/grctl/clients"
|
||||
//"runtime"
|
||||
"fmt"
|
||||
"github.com/bitly/go-simplejson"
|
||||
)
|
||||
|
||||
func NewCmdInit() cli.Command {
|
||||
@ -98,6 +97,7 @@ func initCluster(c *cli.Context) error {
|
||||
arg=""
|
||||
}
|
||||
//logrus.Infof("args is %s,len is %d",arg,len(arg))
|
||||
fmt.Println("开始初始化集群")
|
||||
cmd := exec.Command("bash", "-c",arg+string(b))
|
||||
buf:=bytes.NewBuffer(nil)
|
||||
cmd.Stderr=buf
|
||||
@ -106,11 +106,7 @@ func initCluster(c *cli.Context) error {
|
||||
arr:=strings.SplitN(out,"{",2)
|
||||
arr[1]="{"+arr[1]
|
||||
jsonStr:=arr[1]
|
||||
_,err=simplejson.NewJson([]byte(jsonStr))
|
||||
if err != nil {
|
||||
logrus.Errorf("%s",err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(jsonStr)
|
||||
clients.NodeClient.Tasks().Get("install_manage_ready").Status()
|
||||
return nil
|
||||
|
@ -203,9 +203,10 @@ func Task(c *cli.Context,task string,status bool) error {
|
||||
logrus.Errorf("error get task:%s 's status,details %s",task,err.Error())
|
||||
return err
|
||||
}
|
||||
fmt.Printf("安装中 ")
|
||||
for k,v:=range taskStatus.Status{
|
||||
if v.CompleStatus=="" {
|
||||
fmt.Printf("安装中")
|
||||
if v.Status!="complete" {
|
||||
fmt.Printf(".")
|
||||
continue
|
||||
}else {
|
||||
fmt.Printf("%s is %s-----%s",k,v.CompleStatus,v.Status)
|
||||
|
Loading…
Reference in New Issue
Block a user