From f28f20343dca30bd699ea5ccf696ff2f47920a1a Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 5 May 2016 11:11:42 -0500 Subject: [PATCH] Add Debug handling to examples/config.json Change-Id: Ie94a22ed804686dc0b08206fcd4ccc9b03ad65c1 --- examples/setup.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/setup.go b/examples/setup.go index aeaf26a..3c9197d 100644 --- a/examples/setup.go +++ b/examples/setup.go @@ -19,7 +19,10 @@ package main import ( "encoding/json" + "fmt" "io/ioutil" + + "git.openstack.org/openstack/golang-client.git/openstack" ) // testconfig contains the user information needed by the acceptance and @@ -32,6 +35,7 @@ type testconfig struct { ProjectName string Container string ImageRegion string + Debug bool } // getConfig provides access to credentials in other tests and examples. @@ -44,5 +48,9 @@ func getConfig() *testconfig { if err = json.Unmarshal(userJSON, &config); err != nil { panic("Unmarshal json failed") } + + // Propagate debug setting to packages + openstack.Debug = &config.Debug + fmt.Printf("config: %+v\n", config) return config }