Use API level filtering for nova_security_group provider
In order to speed things up and avoid pulling all the groups, we can instead provide it to the client and it will filter things at the API level speeding the process up. Change-Id: I6798218a3695bfced781056b12a192b82733eea6
This commit is contained in:
@@ -50,9 +50,7 @@ Puppet::Type.type(:nova_security_group).provide(
|
||||
# retrieve all security groups. The following helps filter it.
|
||||
project_id = self.nova_request('token', 'issue', nil, ['-c', 'project_id', '-f', 'value']).strip
|
||||
|
||||
self.nova_request('security group', 'list', nil).select do |attrs|
|
||||
attrs[:project] == project_id
|
||||
end.collect do |attrs|
|
||||
self.nova_request('security group', 'list', nil, ['--project', project_id]).collect do |attrs|
|
||||
new(
|
||||
:ensure => :present,
|
||||
:id => attrs[:id],
|
||||
|
Reference in New Issue
Block a user