status property is not a string
This commit is contained in:
parent
e2f6da1b5f
commit
77f520aa31
@ -7,7 +7,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/oauth2"
|
||||
@ -121,8 +120,9 @@ func UpdateProperty(c *Config, p []properties.PropertyUpdateOrCreate) error {
|
||||
log.Fatal(err)
|
||||
return err
|
||||
}
|
||||
if strings.HasPrefix("2", res.Status) {
|
||||
log.Error(rp[0].Status + rp[0].Description)
|
||||
|
||||
if rp[0].Status >= 400 {
|
||||
log.Error(fmt.Sprint(rp[0].Status) + ":" + rp[0].Description)
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -162,7 +162,7 @@ func DeleteProperty(c *Config, p []properties.PropertyDelete) error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debug(string(response))
|
||||
log.Debug("client.DeleteProperty: response is " + string(response))
|
||||
|
||||
rp := []properties.PropertyDelete{}
|
||||
|
||||
@ -172,8 +172,8 @@ func DeleteProperty(c *Config, p []properties.PropertyDelete) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if strings.HasPrefix("2", res.Status) {
|
||||
log.Error(rp[0].Status + rp[0].Description)
|
||||
if rp[0].Status >= 400 {
|
||||
log.Error(fmt.Sprint(rp[0].Status) + ":" + rp[0].Description)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@ -5,7 +5,7 @@ type Property struct {
|
||||
Name string `json:"vcfg:name"`
|
||||
Value string `json:"vcfg:value"`
|
||||
ID string `json:"vcfg:id,omitempty"`
|
||||
Status string `json:"vcfg:status,omitempty"`
|
||||
Status int `json:"vcfg:status,omitempty"`
|
||||
Prefix string `json:"vcfg:prefix,omitempty"`
|
||||
LastModifiedBy string `json:"vcfg:lastModifiedBy,omitempty"`
|
||||
LastModifiedDate string `json:"vcfg:lastModifiedDate,omitempty"`
|
||||
@ -20,13 +20,13 @@ type PropertyUpdateOrCreate struct {
|
||||
Type string `json:"@type"`
|
||||
Name string `json:"vcfg:name"`
|
||||
Value string `json:"vcfg:value"`
|
||||
Status string `json:"vcfg:status"`
|
||||
Status int `json:"vcfg:status"`
|
||||
Description string `json:"vcfg:description"`
|
||||
}
|
||||
|
||||
type PropertyDelete struct {
|
||||
Type string `json:"@type"`
|
||||
Name string `json:"vcfg:name"`
|
||||
Status string `json:"vcfg:status"`
|
||||
Status int `json:"vcfg:status"`
|
||||
Description string `json:"vcfg:description"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user