[vcloud|compute] make networks working also in organizations

This commit is contained in:
Peter Meier 2011-09-26 14:04:44 +02:00
parent 8743df0bd4
commit 1c727dd689
1 changed files with 8 additions and 3 deletions

View File

@ -14,9 +14,14 @@ module Fog
def all
self.href = connection.default_vdc_href unless self.href
check_href!("Vdc")
if data = connection.get_vdc(href).body[:AvailableNetworks][:Network]
load(data)
if self.href =~ /\/vdc\//
check_href!("Vdc")
if data = connection.get_vdc(self.href).body[:AvailableNetworks][:Network]
load(data)
end
else
check_href!("Org")
load(connection.get_organization(self.href).body[:Link].select{|l| l[:type] == 'application/vnd.vmware.vcloud.network+xml' })
end
end