Refactor #24852
closedHaving empty "Allocation (GB)" when creating a new Host, nil:NilClass returned on creating the Host
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1625258
Description of problem:
When creating a new Host and specifying on Virtual Machine tab "Allocation(GB)" as empty, Host create fails with
NoMethodError: undefined method `[]' for nil:NilClass
error. It is more user-unfriendly also due to the fact that the Allocation(GB) is purged when one clicks to "Size" button right from the value.
How reproducible:
100%
Steps to Reproduce:
1. Start creating a new Host
2. In Virtual Machine tab, click to "Size" button (or leave "Allocation(GB)" empty either way)
3. Fill all other parameters properly.
4. Submit the Host
Actual results:
Host create fails with "undefined method `[]' for nil:NilClass"
Expected results:
Either no error (if the parameter can have empty value with some meaning), or provide some meaningfull error message before tryng to create the host (e.g. similar to leaving root password empty).
Additionally, we could default to size value value in the UI, so that people don't run into the empty value issue that likely + it would provide a good example of what values are expected.
Additional info:
backtrace:
2018-09-04 15:20:37 18507e4a [app] [W] Failed to create a compute satotest (Libvirt) instance pmoravec-test.sysmgmt.lan: undefined method `[]' for nil:NilClass
NoMethodError: undefined method `[]' for nil:NilClass
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-libvirt-0.2.0/lib/fog/libvirt/models/compute/volume.rb:119:in `split_size_unit'
(erb):3:in `to_xml'
Relevant code:
112 def split_size_unit(text)
113 if text.kind_of? Integer
114 # if text is an integer, match will fail
115 size = text
116 unit = 'G'
117 else
118 matcher = text.match(/(\d+)(.+)/)
119 size = matcher1
120 unit = matcher2
121 end
122 [size, unit]
123 end
that simply does not count with empty value in text
Updated by Aditi Puntambekar about 6 years ago
- Subject changed from Having empty "Allocation (GB)" when creating a new Host, nil:NilClass returned on creating the Host to Having empty "Allocation (GB)" when creating a new Host, nil:NilClass returned on creating the Host
- Assignee set to Aditi Puntambekar
Updated by Aditi Puntambekar about 6 years ago
Hello,
I was able to reproduce this on libvirt compute resource, but is this also an issue for other compute resources ?
Updated by Ivan Necas about 6 years ago
As the report says: the source of the issue seems to be in fog-libvirt, so I don't expect other compute resources being affected by this
Updated by The Foreman Bot about 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6300 added
Updated by Aditi Puntambekar about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 23dbf2cd3f4a2aee9e4ed4aaffa294aecd90e591.
Updated by HaroldLapse HaroldLapse 11 months ago
- Tracker changed from Bug to Refactor
- Category changed from Compute resources - libvirt to Host creation
- Assignee changed from Aditi Puntambekar to Griffin Sullivan
- Priority changed from Normal to Immediate
- Difficulty set to medium
- Triaged changed from No to Yes
- Found in Releases 0.1 added
После долгих поисков я наконец-то нашел идеальное место для своего сайта! Виртуальный хостинг, который предоставляет надежность, скорость и доступные цены. Мой сайт теперь работает стабильно, а поддержка клиентов всегда на связи, готовая помочь в любой ситуации. Очень доволен своим выбором и настоятельно рекомендую этот хостинг всем, кто ищет качество без высокой цены! - Рекомедую хостинг от компании [url=https://hidehost.net/]Hidehost.net[/url].Успешно рабоает с 2012 года - Виртуальные сервера от 5.2$/месяц ([url=https://billing.hidehost.net/pl.php?832]https://billing.hidehost.net/pl.php?832[/url])