Skip to content

Commit

Permalink
patchv1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dciangot committed Feb 3, 2020
1 parent aafc872 commit 5a32d23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func (c *Conf) getConf(path string) *Conf {

_, err = clientConf.ListInfIDs()
if err != nil {
re := regexp.MustCompile(`^.*OIDC auth Token expired`)

re := regexp.MustCompile(`^.*OIDC auth Token expired.*`)
if re.Match([]byte(err.Error())) {

fmt.Printf("Token expired, trying to refresh the token ")
Expand Down
9 changes: 4 additions & 5 deletions cmd/utils_dodas.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (clientConf Conf) DestroyInf(infID string) error {
fmt.Println("Removed infrastracture ID: ", infID)
} else {
fmt.Println("ERROR:\n", string(body))
return err
return fmt.Errorf("Error code %d: %s", statusCode, body)
}

return nil
Expand All @@ -123,7 +123,7 @@ func (clientConf Conf) GetInfOutputs(infID string) (outputs map[string]string, e

if statusCode != 200 {
fmt.Println("ERROR:\n", string(body))
return map[string]string{}, err
return map[string]string{}, fmt.Errorf("Error code %d: %s", statusCode, body)
}

var bodyJSON OutputsStruct
Expand Down Expand Up @@ -156,7 +156,7 @@ func (clientConf Conf) GetInfVMStates(infID string, vm string) (status string, e

if statusCode != 200 {
fmt.Println("ERROR:\n", string(body))
return "", err
return "", fmt.Errorf("Error code %d: %s", statusCode, body)
}

var bodyJSON StatusStruct
Expand Down Expand Up @@ -189,8 +189,7 @@ func (clientConf Conf) ListInfIDs() (infIDs []map[string]string, err error) {
}

if statusCode != 200 {
fmt.Println("ERROR:\n", string(body))
return []map[string]string{}, err
return []map[string]string{}, fmt.Errorf("Error code %d: %s", statusCode, body)
}

var bodyJSON ListIDStruct
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package main
const (
VERSION = "v1.0.0"
BUILD_DATE = "2020-02-03 12:11"
BUILD_DATE = "2020-02-03 12:29"
)

0 comments on commit 5a32d23

Please sign in to comment.