Project

General

Profile

Bug #11346

undefined method `lookup_value_match' , deployment of a vmware host by API

Added by Michael Alves Lobo about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When i deploy a vmware host by the dashboard , no problem..
But when i deploy this host with the API i've " undefined method `lookup_value_match' for nil:NilClass (NoMethodError)" in /app/models/nic/managed.rb:94:in `update_lookup_value_fqdn_matchers'

My request params :

Parameters: {"host"=>{"name"=>"test8", "hostgroup_id"=>"561", "compute_resource_id"=>"1", "environment_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>["", "179", "180", "177", "181", "178"], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"test8", "domain_id"=>"1", "subnet_id"=>"78", "ip"=>"10.30.58.8", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"CLOUD_PAR1_INFRA_DEV_DARMA"}}, "new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualE1000", "network"=>"CLOUD_PAR1_INFRA_DEV_DARMA"}}}, "compute_attributes"=>{"cpus"=>"1", "corespersocket"=>"1", "memory_mb"=>"768", "cluster"=>"Cloud-Recette-Cluster", "path"=>"/Centres de données/Cloud-Recette-Cluster/vm", "guest_id"=>"otherGuest64", "scsi_controller_type"=>"ParaVirtualSCSIController", "hardware_version"=>"vmx-09", "start"=>"1", "volumes_attributes"=>{"new_volumes"=>{"_delete"=>"", "datastore"=>"Production Gold 01", "name"=>"Hard disk", "size_gb"=>"10", "thin"=>"true", "eager_zero"=>"false"}, "0"=>{"_delete"=>"", "datastore"=>"Production Gold 01", "name"=>"Hard disk", "size_gb"=>"30", "thin"=>"true", "eager_zero"=>"false"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"7", "ptable_id"=>"11", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"10-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "apiv"=>"v2"}

The method " update_lookup_value_fqdn_matcher" of the class Nic::Managed is call, the :host is empty..
A orchestration problem ?
A bug?
A empty param ?

Michael

Associated revisions

Revision 8561fe99 (diff)
Added by Tom Caspy over 3 years ago

fixes #11346 - on new host, nic shouldn't try to call matcher

there's no point in doing the call anyway (can, theoretically, use the
fqdn field instead of asking the host) because there shouldn't be any
lookup keys with that host's fqdn, as it's a new host.
also, fqdn_was is an empty string in that case

Revision 9f2a0072 (diff)
Added by Tom Caspy over 3 years ago

fixes #11346 - on new host, nic shouldn't try to call matcher

there's no point in doing the call anyway (can, theoretically, use the
fqdn field instead of asking the host) because there shouldn't be any
lookup keys with that host's fqdn, as it's a new host.
also, fqdn_was is an empty string in that case

(cherry picked from commit 8561fe995335b91bc5cd6030ed40a5dd53f3777a)

History

#1 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tom Caspy
  • Pull request https://github.com/theforeman/foreman/pull/3151 added

#2 Updated by Tom Caspy over 3 years ago

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

#3 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 123

Also available in: Atom PDF