Bug 1596850

Summary: Fixes undefined method `name` error during CSV validation required for v2v migration
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: UI - OPSAssignee: Aparna Karve <akarve>
Status: CLOSED CURRENTRELEASE QA Contact: Yadnyawalk Tale <ytale>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, hkataria, lavenel, mpovolny, obarenbo, simaishi, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: 5.9.3.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1596318 Environment:
Last Closed: 2018-07-12 17:42:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1596318    
Bug Blocks:    
Attachments:
Description Flags
5.9.3.1_import_error.png
none
5.9.3.4_import_error_fix.png none

Comment 2 CFME Bot 2018-06-29 19:21:47 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/27c37f1f3e9ca64db05dfbe348bb06b31e19c6d8
commit 27c37f1f3e9ca64db05dfbe348bb06b31e19c6d8
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Fri Jun 29 15:12:11 2018 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Fri Jun 29 15:12:11 2018 -0400

    Merge pull request #17650 from AparnaKarve/fix_csv_describe_vm

    Fixes undefined method `name` error during CSV validation required for v2v migration
    (cherry picked from commit 5ff11a6f899bd9fac9f4146fbbb23b9869995fb9)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1596850

 app/models/transformation_mapping.rb | 11 +-
 app/models/vm.rb | 2 +
 spec/models/transformation_mapping_spec.rb | 7 +
 3 files changed, 16 insertions(+), 4 deletions(-)

Comment 4 Yadnyawalk Tale 2018-07-05 15:19:36 UTC
Created attachment 1456791 [details]
5.9.3.1_import_error.png

Fixed! There was special condition where this validation error comes.
Your VM should be present in a orphan or archive state to get this error (Tried to reproduced error in 5.9.3.1).

Steps:
1. add providers, create map
2. create VM in vcenter (just make sure you can select your VM via discovery)
3. retire this VM (now VM is in orphan state)
4. try to import csv with vm_name in it

```
Name
test-ytale-centos7

```
In 5.9.3.1, we get validation error after import like this (attached image).
5.9.3.4 fixes this bz and give appropriate assertion. (`VM does not exist` in my case)

Thanks for help, Aparna and Allen! 
Verified on: 5.9.3.4.20180702181921_afd03d7

Comment 5 Yadnyawalk Tale 2018-07-05 15:20:21 UTC
Created attachment 1456792 [details]
5.9.3.4_import_error_fix.png