On Fri, Jun 08, 2018 at 11:38:07AM -0400, Laine Stump wrote: > On 06/08/2018 10:55 AM, Daniel P. Berrangé wrote: > > The TCK module requires stuff in the NetworkHelpers and also vica-verca. > > This circular dependancy causes import problems, when trying to use the > > functions in NetworkHelpers from the TCK module. > > > > Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> > > Reviewed-by: Laine Stump <laine@xxxxxxxxx> > > (but see below - there is a pre-existing bug in some code you're moving) > > > --- > > MANIFEST | 1 - > > lib/Sys/Virt/TCK.pm | 71 +++++++++++++++++++++- > > lib/Sys/Virt/TCK/NetworkHelpers.pm | 72 ----------------------- > > scripts/domain/180-interface-parameters.t | 1 - > > scripts/nwfilter/100-ping-still-working.t | 1 - > > scripts/nwfilter/210-no-mac-spoofing.t | 1 - > > scripts/nwfilter/220-no-ip-spoofing.t | 1 - > > scripts/nwfilter/230-no-mac-broadcast.t | 1 - > > scripts/nwfilter/240-no-arp-spoofing.t | 1 - > > scripts/nwfilter/300-vsitype.t | 1 - > > 10 files changed, 70 insertions(+), 81 deletions(-) > > delete mode 100644 lib/Sys/Virt/TCK/NetworkHelpers.pm > > > > diff --git a/MANIFEST b/MANIFEST > > index 9338981..79f93c0 100644 > > --- a/MANIFEST > > +++ b/MANIFEST > > +sub get_network_ip { > > + my $conn = shift; > > + my $netname = shift; > > + diag "getting ip for network $netname"; > > + my $net = $conn->get_network_by_name($netname); > > + my $net_ip = xpath($net, "string(/network/ip[1]/\@address"); > > + my $net_mask = xpath($net, "string(/network/ip[1]/\@netmask"); > > + my $net_prefix = xpath($net, "string(/network/ip[1]/\@prefix"); > > + my $ip; > > + > > + if ($net_mask) { > > + $ip = NetAddr::IP->new($net_ip, $net_mask); > > + } elsif ($net_prefix) { > > + $ip = NetAddr::IP->new("$net_ip/$net_mask"); > > Oops! I just noticed a bug in my function that you've moved - that final > $net_mask should be $net_prefix. I assume you don't want to just squash > that fix into here. Should I wait until you've pushed and send a patch, > or ... ??? Yeah better to send a separate patch Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list