Bug 1508069 - set_network_adapter method erroring out with undefined method `[]' for nil:NilClass')]
Summary: set_network_adapter method erroring out with undefined method `[]' for nil:Ni...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: All
OS: Linux
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Greg McCullough
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks: 1503797 1511501 1511502
TreeView+ depends on / blocked
 
Reported: 2017-10-31 19:12 UTC by Lynn Dixon
Modified: 2021-06-10 13:24 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1511501 1511502 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:42:19 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
method being used to add nics in provisioning request. (1.12 KB, text/plain)
2017-10-31 19:12 UTC, Lynn Dixon
no flags Details

Description Lynn Dixon 2017-10-31 19:12:22 UTC
Created attachment 1346070 [details]
method being used to add nics in provisioning request.

Description of problem:
When trying to provision a VM into VMware and adding additional nics (beyond first nic) during provisioning, using the set_network_adapter method, a cryptic error of "undefined method `[]' for nil:NilClass')]"  results, and automate exits.

Version-Release number of selected component (if applicable):
cfme-5.8.2.3-1.el7cf.x86_64

How reproducible:
Connect CFME 5.8.2 to vCenter version 6.0.0 and use the set_network_adapter method as such:

prov.set_network_adapter(1, {:network => network2, :is_dvs => false} ) 



Actual results:
VM Provision errors out, and subsequent service provision as well with following error:
Calling Create Notification type: automate_user_error subject type: MiqRequest id: 86 options: {:message=>"VM Provision Error: [calo-dev-cfme-wk1] VM [vmw_nics_01] Step [CheckProvisioned] Status [Error Creating VM] Message [[NoMethodError]: undefined method `[]' for nil:NilClass] "}

Expected results:
VM is provisioned and additional nics are added.

Additional info:
CFME 5.8.2
vCenter Version 6.0.0 Build 5318172
VMware template has one nic, but Custom Spec has 5 defined.

I will attach the actual method that I am using in my state machine.  I have this method being called in the Infrastucture --> VM --> Provisioning -> StateMachine -> VMProvision_VM -> Provision VM From Template statemachine.  It is placed in the schema immediately before pre-provisioning.

Comment 7 CFME Bot 2017-11-08 19:44:21 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/master:
https://github.com/ManageIQ/manageiq-providers-vmware/commit/8b196f6027a3bc0ae77f2cbb15ebab58a3309ec5

commit 8b196f6027a3bc0ae77f2cbb15ebab58a3309ec5
Author:     Greg McCullough <gmccullo>
AuthorDate: Sat Nov 4 19:47:35 2017 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Nov 6 09:02:43 2017 -0500

    Properly update network hash when the first array element is nil
    
    Refactor and add tests for normalize_network_adapter_settings
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1508069

 .../provision/configuration/network.rb             | 40 ++++++++++------
 .../provision/configuration/network_spec.rb        | 55 ++++++++++++++++++++++
 2 files changed, 81 insertions(+), 14 deletions(-)
 create mode 100644 spec/models/manageiq/providers/vmware/infra_manager/provision/configuration/network_spec.rb


Note You need to log in before you can comment on or make changes to this bug.