Trying to import an organization, when there is an existing organization with the same name, fails with Caught NoMethodError:undefined method `first' for nil:NilClass while processing following line: {"organization"=>"Richlands", "organization_id"=>"2000"} The problem (I think) is in base.rb rescue RestClient::UnprocessableEntity => ue error " Creation of #{to_singular(entity_type)} failed." errs = JSON.parse(ue.response)['errors'] uniq = errs.first[0] if errs.first[1].is_a?(Array) && errs.first[1][0] =~ /must be unique/ If 'errs' is nil, the uniq= fails. To reproduce: 1) Export orgs from Sat5, containing some org, "Foo" 2) In Sat6, create Foo via webui 3) hammer import organization --csv-file /users/csv/containing/Foo 4) Boom. Need to fix for GA - running into already-named orgs is not unlikely, we need to respond more responsibly
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
"organization_id"=>"2000" ? Man, you really created 2000 organizations on your Sat5? :-)
(In reply to Tomas Lestach from comment #3) > "organization_id"=>"2000" ? > Man, you really created 2000 organizations on your Sat5? :-) Hand-edited so that I could use davido's export without the org-ids colliding with the ones I already had in my Sat6 instance :)
Adapting code to an actual exception ... hammer-cli-import.git: b024521b54766029adf91dcebb5bdafb701ef80b
verified with rubygem-hammer_cli_import-0.10.4-1
Released as part of Sat 6.0 GA