1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge branch 'master' of github.com:fog/fog into create_image

This commit is contained in:
Kyle Rames 2012-12-12 08:57:08 -06:00
commit b2e542d7a3
6 changed files with 29 additions and 5 deletions

View file

@ -22,7 +22,7 @@ module Fog
def users
requires :id
connection.users(:tenant => self)
connection.users(:tenant_id => self.id)
end
def destroy

View file

@ -14,8 +14,17 @@ module Fog
class Mock
def list_users(tenant_id = nil)
users = self.data[:users].values
if tenant_id
users = users.select {
|user| user['tenantId'] == tenant_id
}
end
Excon::Response.new(
:body => { 'users' => self.data[:users].values },
:body => { 'users' => users },
:status => 200
)
end

View file

@ -51,6 +51,10 @@ module Fog
:data => value
}
if ttl
options[:ttl] = ttl
end
if priority
options[:priority] = priority
end
@ -80,6 +84,7 @@ module Fog
options[:type] = type if type
options[:data] = value if value
options[:priority] = priority if priority
options[:ttl] = ttl if ttl
wait_for_job connection.modify_record(@zone.identity, identity, options).body['jobId']
true

View file

@ -13,7 +13,11 @@ module Fog
'type' => record[:type],
'data' => record[:data]
}
if record.has_key? :ttl
record_data['ttl'] = record[:ttl]
end
if record.has_key? :priority
record_data['priority'] = record[:priority]
end

View file

@ -4,6 +4,12 @@ Shindo.tests("Fog::Identity[:openstack] | tenant", ['openstack']) do
instance = Fog::Identity[:openstack].tenants.first
instance.roles_for(0)
end
tests('#users').succeeds do
instance = Fog::Identity[:openstack].tenants.first
instance.users.count != Fog::Identity[:openstack].users.count
end
end
tests('CRUD') do

View file

@ -12,8 +12,8 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
Fog::DNS[:rackspace].list_records(@domain_id).body
end
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1'}])").formats(RECORD_LIST_FORMAT) do
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1'}])
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1', :ttl => 550}])").formats(RECORD_LIST_FORMAT) do
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1', :ttl => 550}])
@record_id = response.body['response']['records'].first['id']
response.body['response']
end