lib/vagrant-openstack-provider/client/neutron.rb in vagrant-openstack-provider-0.4.1 vs lib/vagrant-openstack-provider/client/neutron.rb in vagrant-openstack-provider-0.5.0
- old
+ new
@@ -31,13 +31,23 @@
end
JSON.parse(json)['versions']
end
def get_private_networks(env)
+ get_networks(env, false)
+ end
+
+ def get_all_networks(env)
+ get_networks(env, true)
+ end
+
+ private
+
+ def get_networks(env, all)
networks_json = get(env, "#{@session.endpoints[:network]}/networks")
networks = []
JSON.parse(networks_json)['networks'].each do |n|
- networks << Item.new(n['id'], n['name']) if n['tenant_id'].eql? @session.project_id
+ networks << Item.new(n['id'], n['name']) if all || n['tenant_id'].eql?(@session.project_id)
end
networks
end
end
end