Project

General

Profile

Actions

Bug #18002

open

When creating new VM on Openstack, the availability_zone parameter should be deleted if empty ("no preference")

Added by Imri Zvik over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Compute resources - OpenStack
Target version:
-
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

In Liberty, choosing "No preference" results the following error:
2017-01-10 05:01:15 fa056689 [app] [W] Failed to create a compute CR_Openstack (OpenStack) instance new-host-test: Invalid input for field/attribute availability_zone. Value: . u'' is too short | | RuntimeError: Invalid input for field/attribute availability_zone. Value: . u'' is too short | /usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:139:in `rescue in create_vm' | /usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:122:in `create_vm'

The solution is quite simple - something along the lines of:
args.delete(:availability_zone) if args[:availability_zone].empty?

We will open a PR for this

No data to display

Actions

Also available in: Atom PDF