From 2ff638b08557e645598fb62818f384d7a1309e0f Mon Sep 17 00:00:00 2001 From: Andreas Josephson Date: Thu, 1 Aug 2013 21:19:25 +0200 Subject: [PATCH] [glesys] added options to resuse ip and/or ipv6 and description Adding fog-suport for optional arguments in Glesys::Server#save to support https://github.com/GleSYS/API/wiki/functions_server#wiki-servercreate . --- lib/fog/glesys/models/compute/server.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/fog/glesys/models/compute/server.rb b/lib/fog/glesys/models/compute/server.rb index 3e1e141c1..8af9bd922 100644 --- a/lib/fog/glesys/models/compute/server.rb +++ b/lib/fog/glesys/models/compute/server.rb @@ -67,6 +67,12 @@ module Fog :rootpassword => rootpassword, :transfer => transfer || "500", } + + # optional options when creating a server: + [:ip, :ipv6, :description].each do |k| + options[k] = attributes[k] if attributes[k] + end + data = service.create(options) merge_attributes(data.body['response']['server']) data.status == 200 ? true : false