From ce6fccfb3c0bb3d687ae7a11ef9c9c8f518b9f3c Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Tue, 1 Jul 2014 15:58:35 -0700 Subject: [PATCH] metadata-service: Handle no user-data --- datasource/metadata_service.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/datasource/metadata_service.go b/datasource/metadata_service.go index fff4423..3d9f993 100644 --- a/datasource/metadata_service.go +++ b/datasource/metadata_service.go @@ -65,7 +65,14 @@ func (ms *metadataService) FetchUserdata() ([]byte, error) { } else if _, ok := err.(pkg.ErrTimeout); ok { return data, err } - return client.GetRetry(OpenstackUserdataUrl) + + if data, err := client.GetRetry(OpenstackUserdataUrl); err == nil { + return data, err + } else if _, ok := err.(pkg.ErrNotFound); ok { + return []byte{}, nil + } else { + return data, err + } } func (ms *metadataService) Type() string {