From 2f954dcdc2eb1192360a02a4b2e09e39bb4cc916 Mon Sep 17 00:00:00 2001 From: Janne Paenkaelae Date: Wed, 24 Sep 2014 20:33:29 +0300 Subject: [PATCH] AWS: Eucalyptus 4.x compatibility fix For Eucalyptus 4.0.1 requesting metadata seem to work differently as with EC2. In Euca: > curl http://169.254.169.254/2009-04-04 404 Not Foundunknownunknowncore@localhost ~ $ > curl http://169.254.169.254/2009-04-04/ dynamic meta-data user-data In AWS EC2 > curl http://169.254.169.254/2009-04-04 "" (zero bytes) > curl http://169.254.169.254/2009-04-04/ dynamic meta-data user-data As the isAvailable() function in metadata.go tests only for errorcode it fails in Euca. --- datasource/metadata/ec2/metadata.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datasource/metadata/ec2/metadata.go b/datasource/metadata/ec2/metadata.go index 9e284e6..7061033 100644 --- a/datasource/metadata/ec2/metadata.go +++ b/datasource/metadata/ec2/metadata.go @@ -13,9 +13,9 @@ import ( const ( DefaultAddress = "http://169.254.169.254/" - apiVersion = "2009-04-04" - userdataPath = apiVersion + "/user-data" - metadataPath = apiVersion + "/meta-data" + apiVersion = "2009-04-04/" + userdataPath = apiVersion + "user-data" + metadataPath = apiVersion + "meta-data" ) type metadataService struct {