lib/fog/openstack/examples/storage/set-account-quota.rb in fog-openstack-0.1.2 vs lib/fog/openstack/examples/storage/set-account-quota.rb in fog-openstack-0.1.3

- old
+ new

@@ -1,6 +1,6 @@ -require 'fog' +require 'fog/openstack' require 'pp' # # This example sets the account quota (in bytes) for the tenant demo@test.lan # using an admin account (admin has the reseller user role). @@ -26,21 +26,19 @@ # # We are going to use the Identity (Keystone) service # to retrieve the list of tenants available and find # the tenant we want to set the quotas for. # -id = Fog::Identity.new :provider => 'OpenStack', - :openstack_auth_url => auth_url, - :openstack_username => user, - :openstack_api_key => password +id = Fog::Identity::OpenStack.new :openstack_auth_url => auth_url, + :openstack_username => user, + :openstack_api_key => password # # Storage service (Swift) # -st = Fog::Storage.new :provider => 'OpenStack', - :openstack_auth_url => auth_url, - :openstack_username => user, - :openstack_api_key => password +st = Fog::Storage::OpenStack.new :openstack_auth_url => auth_url, + :openstack_username => user, + :openstack_api_key => password id.tenants.each do |t| # We want to set the account quota for tenant demo@test.lan next unless t.name == 'demo@test.lan'