Skip to content

Commit

Permalink
Add informations at end of a command, and remove that I think is a bl…
Browse files Browse the repository at this point in the history
…ocking command
  • Loading branch information
Acanthostega committed Sep 14, 2013
1 parent a277d50 commit e1213cb
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ loop:
// check the size of commands to execute before
if len(host.Commands) != 0 {

// display
formatter.ColoredPrintln(
formatter.Blue,
true,
"Executing",
len(host.Commands),
"commands for", host.Hostname,
)

// loop over commands on this hosts
for i := host.CommandNumber; i < len(host.Commands); i++ {

// display
formatter.ColoredPrintln(
formatter.Blue,
true,
"Executing command", i, "for", host.Hostname,
)

// number of the command
host.CommandNumber = i

Expand Down Expand Up @@ -151,12 +149,12 @@ loop:
}

// wait here for new jobs
if i == len(host.Commands)-1 {
//if i == len(host.Commands)-1 {

// Wait for other hosts
Waiter(host)
// Wait for other hosts
//Waiter(host)

}
//}

}

Expand Down Expand Up @@ -244,8 +242,8 @@ func Disconnection(
formatter.ColoredPrintln(
formatter.Green,
false,
"Dispatch the jobs of ", host.Hostname,
" to other connected hosts !",
"Dispatch the jobs of", host.Hostname,
"to other connected hosts !",
)

// mark the host as not connected
Expand All @@ -265,7 +263,7 @@ func Disconnection(
formatter.ColoredPrintln(
formatter.Green,
false,
"Dispatching done for ", host.Hostname, " !",
"Dispatching done for", host.Hostname, "!",
)
}

Expand Down Expand Up @@ -386,6 +384,11 @@ func RunCommands(
// Wait for the end of goroutines
for i := 0; i < ncommands; i++ {
<-ender
formatter.ColoredPrintln(
formatter.White,
true,
"Number of remaining commands:", ncommands-1-i,
)
}

}
Expand Down

0 comments on commit e1213cb

Please sign in to comment.