Actions
Bug #13107
closedCompute attributes are stored without indifferent access
Description
Instead of nice error, we error out with:
Failed to login via SSH to xxx: undefined method `username' for nil:NilClass
I think in this case when image was not selected, we should simply skip ssh provisioning. Another option is to raise an error.
Updated by Lukas Zapletal over 9 years ago
Oh it looks like this error triggers always, even if you select an image. Testing with OS.
Updated by Lukas Zapletal over 9 years ago
Looks like the image gets stored properly (image_ref) but the ssh_provision orchestrator is returned nil:
2016-01-11T11:51:14 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxxx+BtOzpO938g=", "host"=>{"name"=>"lzap-test-04", "organization_id"=>"3", "location_id"=>"1", "hostgroup_id"=>"7", "compute_resource_id"=>"5", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"lzap-test-04", "domain_id"=>"1", "subnet_id"=>"1", "ip"=>"192.168.122.20", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>""}}, "compute_attributes"=>{"flavor_ref"=>"83098b08-7339-4089-bc07-3f2a14b7a4c1", "availability_zone"=>"", "tenant_id"=>"2f58867f4fa54a09a266b26ef410d313", "security_groups"=>"lzap-group", "nics"=>[""], "network"=>"os1_internal", "boot_from_volume"=>"false", "size_gb"=>"", "image_ref"=>"2695dbd9-e1b1-47a8-9ac3-4e8854aa55aa"}, "architecture_id"=>"1", "operatingsystem_id"=>"5", "provision_method"=>"image", "build"=>"1", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"1-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image", "provider"=>"Openstack", "bare_metal_capabilities"=>"build"}
Host -> Image reference does not get updated properly.
Updated by Lukas Zapletal over 9 years ago
It looks like again, hash with symbol vs string in my case:
[8] pry(#<Host::Managed>)> compute_attributes => {"flavor_ref"=>"83098b08-7339-4089-bc07-3f2a14b7a4c1", "availability_zone"=>"", "tenant_id"=>"2f58867f4fa54a09a266b26ef410d313", "security_groups"=>"lzap-group", "nics"=>[""], "network"=>"os1_internal", "boot_from_volume"=>"false", "size_gb"=>"", "image_ref"=>"2695dbd9-e1b1-47a8-9ac3-4e8854aa55aa", "interfaces_attributes"=>{"0"=>{}}} [9] pry(#<Host::Managed>)> compute_attributes[:image_ref] => nil
Updated by Lukas Zapletal over 9 years ago
- Subject changed from Image reference is not stored, ssh provisioning fails to Compute attributes are stored without indifferent access
So this is all about indifferent access, looks like the attribute is somehow converted back to regular hash, which breaks our code.
Updated by Lukas Zapletal over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 65b6d7c402143e1f96182d6bfd4815cbc4bbb502.
Actions