Bug 1726586

Summary: virt-manager throws error when enabling IPv6 during virtual network creation and switching to XML tab
Product: [Community] Virtualization Tools Reporter: Simon Kobyda <skobyda>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, tburke
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-29 23:57:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simon Kobyda 2019-07-03 08:51:19 UTC
Description of problem:
virt-manager throws error when enabling IPv6 during virtual network creation and switching to XML tab

Version-Release number of selected component (if applicable):
2.2.0

How reproducible:


Steps to Reproduce:
1. Open window for adding a new virtual network
2. In IPv6 configuration, check Enable IPv6. Leave "Network" option empty.
3. Switch to XML tab

Actual results:
virt-manager returns error:
Error building XML: 'NoneType' object has no attribute 'network_address'

Traceback (most recent call last):
  File "/home/skobyda/Work/virt-manager/virtManager/createnet.py", line 447, in _build_xmlobj
    xmlobj = self._build_xmlobj_from_ui()
  File "/home/skobyda/Work/virt-manager/virtManager/createnet.py", line 431, in _build_xmlobj_from_ui
    ipobj.address = str(ip.network_address + 1)
AttributeError: 'NoneType' object has no attribute 'network_address'


Expected results:
See adjusted XML or virt-manager should not allow to leave "Network" option empty.

Comment 1 Cole Robinson 2019-07-03 23:16:21 UTC
Thanks for the report. Yeah this is annoying, and will hit for a ipv4 and the dhcp fields too. Something to clean up when adding full test_ui code coverage

Comment 2 Cole Robinson 2020-01-29 23:57:15 UTC
Fixed upstream now

commit 5573aeb44100bcabdc24ab1cd19ec96bb4cb9d62 (HEAD -> master, origin/master, origin/HEAD, work)
Author: Cole Robinson <crobinso>
Date:   Wed Jan 29 18:43:58 2020 -0500

    createnet: Fix XML editor error when dhcp fields are empty