From c258dee6ecf4bc7fead5821adf1107f8cb5b8bab Mon Sep 17 00:00:00 2001 From: Nat Welch Date: Fri, 4 Oct 2013 15:06:42 -0700 Subject: [PATCH] [google|compute] Fix metadata bug. Works for when you have metadata, but no sshKeys metadata. --- lib/fog/google/models/compute/server.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fog/google/models/compute/server.rb b/lib/fog/google/models/compute/server.rb index 895f5f482..67393fcb0 100644 --- a/lib/fog/google/models/compute/server.rb +++ b/lib/fog/google/models/compute/server.rb @@ -74,6 +74,10 @@ module Fog # You can have multiple SSH keys, seperated by newlines. # https://developers.google.com/compute/docs/console?hl=en#sshkeys + if !self.metadata["sshKeys"] + self.metadata["sshKeys"] = "" + end + if !self.metadata["sshKeys"].empty? self.metadata["sshKeys"] += "\n" end