fix user_enabled/tenant_enabled boolean TypeError
ERROR: Unable to create tenant 'service' ERROR: Error was: can't convert true into String Fixes bug 1184614 Change-Id: I28b751b30f9b2c90e7151b282ae62253383dca52
This commit is contained in:
@@ -35,10 +35,8 @@ end
|
||||
private
|
||||
def identity_command resource, cmd, args={}
|
||||
keystonecmd = ['keystone'] << cmd
|
||||
args.each { |key,val|
|
||||
if val
|
||||
keystonecmd << "--#{key}" << val
|
||||
end
|
||||
args.each { |key, val|
|
||||
keystonecmd << "--#{key}" << val.to_s
|
||||
}
|
||||
Chef::Log.debug("Running identity command: #{keystonecmd}")
|
||||
rc = shell_out(keystonecmd, :env => generate_creds(resource))
|
||||
|
||||
@@ -184,4 +184,22 @@ describe Chef::Provider::Execute do
|
||||
provider.run_action(:create_ec2_credentials)
|
||||
@ec2_resource.should_not be_updated
|
||||
end
|
||||
|
||||
describe "#identity_command" do
|
||||
it "should handle false values and long descriptions" do
|
||||
provider = Chef::Provider::OpenstackIdentityRegister.new(
|
||||
@user_resource, @run_context)
|
||||
|
||||
provider.stub!(:shell_out).with(
|
||||
["keystone", "user-create", "--enabled", "false",
|
||||
"--description", "more than one word"],
|
||||
{:env => {"OS_SERVICE_ENDPOINT" => nil, "OS_SERVICE_TOKEN" => nil}}
|
||||
).and_return double("shell_out", :exitstatus => 0, :stdout => "good")
|
||||
|
||||
provider.send(
|
||||
:identity_command, @user_resource, "user-create",
|
||||
{"enabled" => false, "description" => "more than one word"}
|
||||
).should eq "good"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user