Module: Fog::Compute::Google::Shared

Included in:
Mock, Real
Defined in:
lib/fog/google/requests/compute/delete_server.rb

Instance Method Summary collapse

Instance Method Details

#find_zone(zone_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fog/google/requests/compute/delete_server.rb', line 5

def find_zone(zone_name)
  if zone_name.nil?
    list_zones.body['items'].each do |zone|
      if get_server(server_name, zone['name']).status == 200
        return zone['name']
      end
    end
  else
    if zone_name.is_a? Excon::Response
      return zone_name.body["name"]
    end
  end
  return zone_name
end