Description of problem: If you name a deployment something that includes a space (not sure if this also applies to special characters as well, it could), when it comes time during RHEV deployment and configuration, the template import will fail, since it names the template after the deployment, but doesn't replace the spaces, and doesn't wrap the name in quotes. Error Unable to import template: Status: 1. Output: ["'NoneType' object has no attribute 'import_template'\n", "Error importing template 'another' to export domain 'my_export'\n"] [E] Error running command: /usr/share/fusor_ovirt/bin/ovirt_import_template.py --api_user [redacted] --api_pass [redacted] --api_host [redacted] --cluster_name Default --data_center_name Default --export_domain_name my_export --storage_domain_name my_storage --vm_template_name another space name-cfme-template Seems like need to be creating the equivalent of a deployment label behind the scenes, similar to how we sanitize organization and environment path names that contain spaces and special characters, and replace them with underscores. That way we don't end up trying to feed a cli command an input with spaces that will break. Not sure if we could get away with wrapping the --vm_template_name input in quotes. Version-Release number of selected component (if applicable): Tech Preview Actual results: UI accepts a deployment name with a space, which later breaks the deployment process Expected results: User should be able to name the deployment what they want, and have it format the name however it needs to on the backend for it to work properly Additional info:
Plan is to update fusor_server so when it calls out to external scripts it quotes the parameters correctly to handle spaces
An exclamation point in the name was fine, but a single quote forced a failed deployment as well.
I saw a similar error due to a '+' in the deployment name. My one was: ovirtsdk.infrastructure.errors.RequestError: status: 400 reason: Bad Request detail: Can not add VM. The given name contains special characters. Only lower-case and upper-case letters, numbers, '_', '-', '.' are allowed. [E] Error running command: /usr/share/fusor_ovirt/bin/ovirt_create_vm_from_template.py --api_host <retracted> --api_pass <retracted> --vm_template_name apagac-rhevm+cfme4-cfme-template --cluster_name Default --vm_name apagac-rhevm+cfme4-cfme I named the deployment: apagac-rhevm+cfme4
I'd suggest, since special characters seem to be causing problems in numerous areas that we limit deployment names to a-z A-Z 0-9 _ - Is there a downside to limiting the deployment name to these characters?
I would prefer to see us accept spaces in deployment names, and swap them out for underscores on the backend (or however we can handle it). As far as I know, that's what Satellite does for most of its underlying parts. If I create an org in Satellite, I can use a name of "My Org" and it will assign it a label of "My_Org". It's a lot more natural to use a space for a name. Special characters would be nice, if they want to use + or & or something (like the above comment), but probably not as critical.
Temporarily patching to disallow spaces.
PR621: https://github.com/fusor/fusor/pull/621
I can't create deployment with space in the name. Other characters to consider are beyond the scope of this bug, so marking as verified. RHCI-6.0-RHEL-7-20160122.t.1-RHCI-x86_64-dvd1.iso