Skip to content

Commit

Permalink
Merge pull request #48 from CiscoCloud/fix/framework-uninstall
Browse files Browse the repository at this point in the history
remove framework even if not active
  • Loading branch information
ryane committed Jun 9, 2016
2 parents eeb4faa + 3762c99 commit f3900fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test: deps quicktest
go vet $(TEST)

docker: deps
find . -name ".DS_Store" -depth -exec rm {} \;
docker build -t $(DOCKERREPO)/$(NAME) .
docker tag -f $(DOCKERREPO)/$(NAME) $(DOCKERREPO)/$(NAME):$(VERSION)

Expand Down
10 changes: 6 additions & 4 deletions mesos/mesos.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/CiscoCloud/mantl-api/utils/http"
log "github.com/Sirupsen/logrus"
"io/ioutil"
"os"
"strconv"
"strings"

"github.com/CiscoCloud/mantl-api/utils/http"
log "github.com/Sirupsen/logrus"
)

type Mesos struct {
Expand Down Expand Up @@ -102,7 +103,6 @@ func (m Mesos) Shutdown(frameworkId string) error {
}

func (m Mesos) ShutdownFrameworkByName(name string) error {
log.Debugf("Looking for %s framework", name)

// find mesos framework
fw, err := m.FindFramework(name)
Expand All @@ -125,9 +125,11 @@ func (m Mesos) FindFrameworks(name string) ([]*Framework, error) {
return []*Framework{}, err
}

log.Debugf("mesos.FindFrameworks: looking for framework %s", name)
matching := make(map[string]*Framework)
for _, fw := range state.Frameworks {
if fw.Name == name && fw.Active {
log.Debugf("mesos.FindFrameworks: framework %s - %s - %t", fw.Name, fw.ID, fw.Active)
if strings.EqualFold(fw.Name, name) {
matching[fw.ID] = fw
}
}
Expand Down

0 comments on commit f3900fd

Please sign in to comment.