Re: [virt-manager PATCH 1/2] createinterface: raise value error when no ip addr set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/28/2014 02:57 AM, Chen Hanxiao wrote:
> We could set blank ip address
> 
> IP setting->Configure->Mode (static), then press "OK".
> 
> And libvirt will throw an error not very helpful:
> Error creating interface: 'Could not define interface:
> XML error: could not get interface XML description:
> XML invalid - Element protocol failed to validate attributes.
> 
> This patch will forbid setting an empty ip address.
> 
> Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
> ---
>  virtManager/createinterface.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virtManager/createinterface.py b/virtManager/createinterface.py
> index 11fc9b2..4588bba 100644
> --- a/virtManager/createinterface.py
> +++ b/virtManager/createinterface.py
> @@ -764,7 +764,7 @@ class vmmCreateInterface(vmmGObjectUI):
>      def build_ip_info(self):
>          def build_ip(addr_str):
>              if not addr_str:
> -                return None, None
> +                raise ValueError(_("Please enter an IP address"))
>              ret = addr_str.rsplit("/", 1)
>              address = ret[0]
>              prefix = None
> 

ACK to this one

- Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux