From a5e5505b512d22b3b650cd76542ebdaee8155645 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 13 Mar 2014 21:47:59 -0700 Subject: [PATCH] fix(metadata): correctly read metadata svc resp --- cloudinit/metadata_service.go | 2 +- coreos-cloudinit.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudinit/metadata_service.go b/cloudinit/metadata_service.go index 8125dcb..314831b 100644 --- a/cloudinit/metadata_service.go +++ b/cloudinit/metadata_service.go @@ -21,7 +21,7 @@ func (ms *metadataService) UserData() ([]byte, error) { } defer resp.Body.Close() - if resp/100 != 2 { + if resp.StatusCode / 100 != 2 { return []byte{}, nil } diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go index 102bc44..a1a2ce8 100644 --- a/coreos-cloudinit.go +++ b/coreos-cloudinit.go @@ -61,7 +61,7 @@ func main() { os.Exit(1) } - if userdata == "" { + if len(userdata) == 0 { log.Printf("No user data to handle, exiting.") os.Exit(0) }