Project

General

Profile

Actions

Bug #13107

closed

Compute attributes are stored without indifferent access

Added by Lukas Zapletal over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by Lukas Zapletal over 8 years ago

Oh it looks like this error triggers always, even if you select an image. Testing with OS.

Actions #2

Updated by Lukas Zapletal over 8 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.

Actions #3

Updated by Lukas Zapletal over 8 years ago

  • Subject changed from When image is not selected, ssh provisioning fails to Image reference is not stored, ssh provisioning fails
Actions #4

Updated by Lukas Zapletal over 8 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
Actions #5

Updated by Lukas Zapletal over 8 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.

Actions #6

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 71
Actions #7

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman/pull/3051 added
Actions #8

Updated by Lukas Zapletal about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF