Apply suggestions from code review
parent
e28a1b411b
commit
ee22b47795
|
@ -585,7 +585,7 @@ func deleteMachineDirectories(cc *config.ClusterConfig) {
|
|||
}
|
||||
|
||||
// killMountProcess looks for the legacy path and for profile path for a pidfile,
|
||||
// it then tries to kill all the pids listed in the pidfile(one or more)
|
||||
// it then tries to kill all the pids listed in the pidfile (one or more)
|
||||
func killMountProcess() error {
|
||||
profile := viper.GetString("profile")
|
||||
paths := []string{
|
||||
|
@ -602,7 +602,7 @@ func killMountProcess() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// killProcess takes a path to look for a pidfile(space-separated),
|
||||
// killProcess takes a path to look for a pidfile (space-separated),
|
||||
// it reads the file and converts it to a bunch of pid ints,
|
||||
// then it tries to kill each one of them.
|
||||
// If no errors were ecnountered, it cleans the pidfile
|
||||
|
@ -634,14 +634,14 @@ func killProcess(path string) error {
|
|||
} else if len(errs) != 0 {
|
||||
// if multiple errors were encountered, we're outputting them
|
||||
// and returning a new multiple-errors error:
|
||||
out.Step(style.Failure, "Ecountered multiple errors:")
|
||||
out.Styled(style.Failure, "Multiple errors encountered:")
|
||||
for _, e := range errs {
|
||||
out.Err("%v\n", e)
|
||||
}
|
||||
return errors.New("multiple errors encountered while closing mount processes")
|
||||
}
|
||||
|
||||
// if no errors were encoutered, it is safe to clean out the pidFile
|
||||
// if no errors were encoutered, it's safe to delete pidFile
|
||||
if err := os.Remove(pidPath); err != nil {
|
||||
return errors.Wrap(err, "While closing mount-pids file")
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no
|
|||
// if something weird has happened from previous tests..
|
||||
// this could at least spare us some waiting
|
||||
if strings.Contains(rr.Stdout.String(), fmt.Sprintf("Profile \"%s\" not found.", profile)) {
|
||||
t.Fatalf("somehow the profile got cancelled; failing....")
|
||||
t.Fatalf("profile was deleted, cancelling the test")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no
|
|||
for _, mntp := range mntProcs {
|
||||
// Trying to wait for process end
|
||||
// if the wait fail with ExitError we know that the process
|
||||
// doesnt' exist anymore..
|
||||
// doesn't exist anymore..
|
||||
go func(end chan bool) {
|
||||
err := mntp.cmd.Wait()
|
||||
if _, ok := err.(*exec.ExitError); ok {
|
||||
|
|
Loading…
Reference in New Issue