[REV] optimize basic output,remove wrong json

This commit is contained in:
bay1ts 2017-11-28 11:45:30 +08:00
parent 2702cfc3f8
commit c11cecf1d2
2 changed files with 5 additions and 8 deletions

View File

@ -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

View File

@ -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)