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:
commit
b2e542d7a3
6 changed files with 29 additions and 5 deletions
|
@ -22,7 +22,7 @@ module Fog
|
||||||
|
|
||||||
def users
|
def users
|
||||||
requires :id
|
requires :id
|
||||||
connection.users(:tenant => self)
|
connection.users(:tenant_id => self.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -14,8 +14,17 @@ module Fog
|
||||||
|
|
||||||
class Mock
|
class Mock
|
||||||
def list_users(tenant_id = nil)
|
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(
|
Excon::Response.new(
|
||||||
:body => { 'users' => self.data[:users].values },
|
:body => { 'users' => users },
|
||||||
:status => 200
|
:status => 200
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,6 +51,10 @@ module Fog
|
||||||
:data => value
|
:data => value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ttl
|
||||||
|
options[:ttl] = ttl
|
||||||
|
end
|
||||||
|
|
||||||
if priority
|
if priority
|
||||||
options[:priority] = priority
|
options[:priority] = priority
|
||||||
end
|
end
|
||||||
|
@ -80,6 +84,7 @@ module Fog
|
||||||
options[:type] = type if type
|
options[:type] = type if type
|
||||||
options[:data] = value if value
|
options[:data] = value if value
|
||||||
options[:priority] = priority if priority
|
options[:priority] = priority if priority
|
||||||
|
options[:ttl] = ttl if ttl
|
||||||
|
|
||||||
wait_for_job connection.modify_record(@zone.identity, identity, options).body['jobId']
|
wait_for_job connection.modify_record(@zone.identity, identity, options).body['jobId']
|
||||||
true
|
true
|
||||||
|
|
|
@ -14,6 +14,10 @@ module Fog
|
||||||
'data' => record[:data]
|
'data' => record[:data]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if record.has_key? :ttl
|
||||||
|
record_data['ttl'] = record[:ttl]
|
||||||
|
end
|
||||||
|
|
||||||
if record.has_key? :priority
|
if record.has_key? :priority
|
||||||
record_data['priority'] = record[:priority]
|
record_data['priority'] = record[:priority]
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,12 @@ Shindo.tests("Fog::Identity[:openstack] | tenant", ['openstack']) do
|
||||||
instance = Fog::Identity[:openstack].tenants.first
|
instance = Fog::Identity[:openstack].tenants.first
|
||||||
instance.roles_for(0)
|
instance.roles_for(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
tests('#users').succeeds do
|
||||||
|
instance = Fog::Identity[:openstack].tenants.first
|
||||||
|
|
||||||
|
instance.users.count != Fog::Identity[:openstack].users.count
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
tests('CRUD') do
|
tests('CRUD') do
|
||||||
|
|
|
@ -12,8 +12,8 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
||||||
Fog::DNS[:rackspace].list_records(@domain_id).body
|
Fog::DNS[:rackspace].list_records(@domain_id).body
|
||||||
end
|
end
|
||||||
|
|
||||||
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1'}])").formats(RECORD_LIST_FORMAT) do
|
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'}])
|
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']
|
@record_id = response.body['response']['records'].first['id']
|
||||||
response.body['response']
|
response.body['response']
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue