mirror of
https://github.com/rancher/norman.git
synced 2025-09-03 00:06:24 +00:00
Make debug variable public
This commit is contained in:
@@ -24,7 +24,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
debug = false
|
Debug = false
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIBaseClientInterface interface {
|
type APIBaseClientInterface interface {
|
||||||
@@ -346,8 +346,8 @@ func (a *APIBaseClient) Action(schemaType string, action string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true"
|
Debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true"
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("Rancher client debug on")
|
fmt.Println("Rancher client debug on")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject inter
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("GET " + url)
|
fmt.Println("GET " + url)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject inter
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
fmt.Println("Response <= " + string(byteContent))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ func (a *APIOperations) DoModify(method string, url string, createObj interface{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println(method + " " + url)
|
fmt.Println(method + " " + url)
|
||||||
fmt.Println("Request => " + string(bodyContent))
|
fmt.Println("Request => " + string(bodyContent))
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ func (a *APIOperations) DoModify(method string, url string, createObj interface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(byteContent) > 0 {
|
if len(byteContent) > 0 {
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
fmt.Println("Response <= " + string(byteContent))
|
||||||
}
|
}
|
||||||
return json.Unmarshal(byteContent, respObject)
|
return json.Unmarshal(byteContent, respObject)
|
||||||
@@ -293,7 +293,7 @@ func (a *APIOperations) doAction(
|
|||||||
|
|
||||||
var input io.Reader
|
var input io.Reader
|
||||||
|
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("POST " + actionURL)
|
fmt.Println("POST " + actionURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ func (a *APIOperations) doAction(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("Request => " + string(bodyContent))
|
fmt.Println("Request => " + string(bodyContent))
|
||||||
}
|
}
|
||||||
input = bytes.NewBuffer(bodyContent)
|
input = bytes.NewBuffer(bodyContent)
|
||||||
@@ -333,7 +333,7 @@ func (a *APIOperations) doAction(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if debug {
|
if Debug {
|
||||||
fmt.Println("Response <= " + string(byteContent))
|
fmt.Println("Response <= " + string(byteContent))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user