Bug 1557942 - RuntimeError(_("Hostname is required")) cannot be triggered
Summary: RuntimeError(_("Hostname is required")) cannot be triggered
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: virt-mgr-maint
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-19 10:44 UTC by Xiaodai Wang
Modified: 2018-03-20 01:20 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-03-19 14:33:04 UTC
Embargoed:


Attachments (Terms of Use)

Description Xiaodai Wang 2018-03-19 10:44:20 UTC
Description of problem:
RuntimeError(_("Hostname is required")) cannot be triggered

Version-Release number of selected component (if applicable):
virt-manager-1.4.3-3.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Click 'Add Pool' button in virt-manager.
2. Select netfs pool type and set any pool name for it.
3. click 'Forward'.
4. Leave 'Host Name' and 'Source Path' as blank, then click 'Finish'.

Actual results:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/createpool.py", line 395, in forward
    if self.validate(notebook.get_current_page()) is not True:
  File "/usr/share/virt-manager/virtManager/createpool.py", line 547, in validate
    return self._validate_page_format()
  File "/usr/share/virt-manager/virtManager/createpool.py", line 527, in _validate_page_format
    self._pool.validate()
  File "/usr/share/virt-manager/virtinst/storage.py", line 509, in validate
    raise RuntimeError(_("Source path is required"))
RuntimeError: Source path is required


Expected results:
RuntimeError(_("Hostname is required"))

Additional info:
Should argument be "hosts" instead of "host"?

    def validate(self):
        if self.supports_property("host") and not self.hosts:
            raise RuntimeError(_("Hostname is required"))

Comment 1 Cole Robinson 2018-03-19 14:33:04 UTC
Thanks for the report, fixed upstream now. Just closing this as upstream since it's a small validation issue and not needed to track for RHEL

commit 3d34f6a231a7080f6c6c5e893832c4d652626026 (HEAD -> master)
Author: Cole Robinson <crobinso>
Date:   Mon Mar 19 10:29:00 2018 -0400

    storage: Fix validating empty hosts value (bz #1557942)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1557942


Note You need to log in before you can comment on or make changes to this bug.