Description of problem: Currently there is no validation in the CSV importer being performed to check against empty and invalid FQDNs (for system import) and perhaps others as well. Thus it is possible to import gibberish. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Validation similar to the Web UI should be performed. Additional info:
This suggests we're currently doing the data validation in the wrong place (in the view code rather than the model code). Rather than duplicating the existing validation logic in the CSV import, we should move the validation lower in the stack and use the bkr.server.flask_util.convert_internal_exceptions helper to translate from ValueError back to the appropriate HTTP error code.
On gerrit: http://gerrit.beaker-project.org/#/c/2617/2
*** Bug 1021738 has been marked as a duplicate of this bug. ***
Verify: 1. invalid FQDNs Import CSV file: csv_type,fqdn,deleted,lender,location,mac_address,memory,model,serial,vendor,arch,lab_controller,owner,secret,status,type,cc system,,False,,Nay,00:21:9B:4F:DB:68,7742,OptiPlex 780,,Red Hat,"i386,x86_64",beaker,beaker,False,Broken,Machine, Error Log Error importing system on line 2: System must have an associated FQDN 2. invalid Lab-controller. Import CSV file: csv_type,fqdn,deleted,lender,location,mac_address,memory,model,serial,vendor,arch,lab_controller,owner,secret,status,type,cc system,hss,False,,Nay,,7742,OptiPlex 780,,Red Hat,"i386,x86_64",beaker,beaker,False,Broken,Machine, Error Log hss: Invalid lab controller beaker
To help me assess the significance of this: can a new system still be uploaded using a CSV that has *no* system column at all?
Created attachment 856341 [details] keyvalue Fresh install beaker environment, and upload this file
Well, seems #comment 8 is a different bug, so open a bug for it.https://bugzilla.redhat.com/show_bug.cgi?id=1058549 And move this bug to "VERIFIED"
This change is included in the Beaker 0.15.3 maintenance release: http://beaker-project.org/docs/whats-new/release-0.15.html#beaker-0-15-3