diff --git a/lib/puppet/provider/keystone.rb b/lib/puppet/provider/keystone.rb index 3bb4251d4..7a53e927c 100644 --- a/lib/puppet/provider/keystone.rb +++ b/lib/puppet/provider/keystone.rb @@ -103,17 +103,6 @@ class Puppet::Provider::Keystone < Puppet::Provider::Openstack resource_to_name(*name_to_resource(name), false) end -# def self.roles_assignement_for_userid(user_id) -# unless @role_assignement_table -# @role_assignement_table = request('role assignment', 'list') -# end -# roles_id = [] -# @role_assignement_table.each do |row| -# roles_id << row[:role] if row[:user] == user_id -# end -# roles_id -# end - def self.user_id_from_name_and_domain_name(name, domain_name) @users_name ||= {} id_str = "#{name}_#{domain_name}" diff --git a/spec/unit/provider/keystone_user/openstack_spec.rb b/spec/unit/provider/keystone_user/openstack_spec.rb index 6357ef859..6e8c0bca1 100644 --- a/spec/unit/provider/keystone_user/openstack_spec.rb +++ b/spec/unit/provider/keystone_user/openstack_spec.rb @@ -79,7 +79,9 @@ username="user1" described_class.expects(:openstack) .with('user', 'show', '--format', 'shell', ['user1', '--domain', 'domain1_id']) - .returns('') + .twice + .raises(Puppet::ExecutionFailure, + "No user with a name or ID of 'user1' exists.") expect(provider.exists?).to be_falsey end end