diff --git a/tsuru/client/certificate_test.go b/tsuru/client/certificate_test.go index 0fabb1755..5a2b6cee5 100644 --- a/tsuru/client/certificate_test.go +++ b/tsuru/client/certificate_test.go @@ -10,7 +10,6 @@ import ( "io/ioutil" "net/http" "os" - "strconv" "strings" "time" @@ -21,13 +20,6 @@ import ( check "gopkg.in/check.v1" ) -func convert(b []byte) string { - s := make([]string, len(b)) - for i := range b { - s[i] = strconv.Itoa(int(b[i])) - } - return strings.Join(s, ",") -} func (s *S) TestCertificateSetRunSuccessfully(c *check.C) { var stdout, stderr bytes.Buffer context := cmd.Context{ diff --git a/tsuru/client/permission.go b/tsuru/client/permission.go index 14322e9e2..05aed14a6 100644 --- a/tsuru/client/permission.go +++ b/tsuru/client/permission.go @@ -557,14 +557,11 @@ func (c *RoleDefaultAdd) Run(ctx *cmd.Context, client *cmd.Client) error { params.Add(name, val) } } - rolname := []string{} roleMap := make(map[string][]string) for k := range params { - rolname = append(rolname, k) - for _, n := range params[k] { - roleMap[k] = append(roleMap[k], n) - } + roleMap[k] = append(roleMap[k], params[k]...) } + rolDef := c.RoleDefAdd(roleMap) apiClient, err := tsuruClient.ClientFromEnvironment(&tsuru.Configuration{ HTTPClient: client.HTTPClient,