FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 10-06-2008, 02:12 PM
Mark McLoughlin
 
Default Fix virt-install --bridge

If you run virt-install with --bridge, you get:

ERROR Cannot mix both --bridge and --network arguments

because digest_networks() is comparing [] to None.

Reduce confusion by also normalizing the bridges argument to
a list and evaluating the lists as bools.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

diff -r ca48e58d85ec virtinst/cli.py
--- a/virtinst/cli.py Fri Oct 03 14:23:37 2008 -0400
+++ b/virtinst/cli.py Mon Oct 06 15:11:31 2008 +0100
@@ -277,24 +277,22 @@
guest.nics.append(n)

def digest_networks(conn, macs, bridges, networks, nics = 0):
- if type(bridges) != list and bridges != None:
- bridges = [ bridges ]
+ def listify(l):
+ if l is None:
+ return []
+ elif type(l) != list:
+ return [ l ]
+ else:
+ return l

- if macs is None:
- macs = []
- elif type(macs) != list:
- macs = [ macs ]
-
- if networks is None:
- networks = []
- elif type(networks) != list:
- networks = [ macs ]
+ macs = listify(macs)
+ bridges = listify(bridges)
+ networks = listify(networks)

- if bridges is not None and networks != None:
+ if bridges and networks:
fail(_("Cannot mix both --bridge and --network arguments"))

-
- if bridges != None:
+ if bridges:
networks = map(lambda b: "bridge:" + b, bridges)

# ensure we have less macs then networks. Auto fill in the remaining


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 10-06-2008, 04:23 PM
Cole Robinson
 
Default Fix virt-install --bridge

Mark McLoughlin wrote:
> If you run virt-install with --bridge, you get:
>
> ERROR Cannot mix both --bridge and --network arguments
>
> because digest_networks() is comparing [] to None.
>
> Reduce confusion by also normalizing the bridges argument to
> a list and evaluating the lists as bools.
>

Thanks, applied:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=2aba69a1a16c

I'll make sure this is pulled in for f10 as well.

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 04:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org