77#
88# pylint: disable=protected-access
99"""A module that defines objects for standalone use."""
10+
1011import asyncio
1112import base64
1213import errno
2526from copy import deepcopy
2627from pathlib import Path
2728
28-
2929try :
3030 # We only want to require yaml for the gen cloud image feature
3131 import yaml
5454from .config import merge_kind_config
5555from .watchlog import WatchLog
5656
57-
5857AUTO_LOOPBACK_IPV4_BASE = ipaddress .ip_interface ("10.255.0.0/32" )
5958AUTO_LOOPBACK_IPV6_BASE = ipaddress .ip_interface ("fcfe::0/128" )
6059
@@ -75,7 +74,7 @@ def get_loopback_ips(c, nid):
7574 if ipv6 := c .get ("ipv6" ):
7675 if ipv6 == "auto" :
7776 ips .append (AUTO_LOOPBACK_IPV6_BASE + nid )
78- elif isinstance (ip , str ):
77+ elif isinstance (ipv6 , str ):
7978 ips .append (ipaddress .ip_interface (ipv6 ))
8079 else :
8180 ips .extend ([ipaddress .ip_interface (x ) for x in ipv6 ])
@@ -833,15 +832,13 @@ def __init__(self, *args, unet=None, **kwargs):
833832 # Create a hosts file to map our name
834833 hosts_file = os .path .join (self .rundir , "hosts.txt" )
835834 with open (hosts_file , "w" , encoding = "ascii" ) as hf :
836- hf .write (
837- f"""127.0.0.1\t localhost { self .name }
835+ hf .write (f"""127.0.0.1\t localhost { self .name }
838836::1\t ip6-localhost ip6-loopback
839837fe00::0\t ip6-localnet
840838ff00::0\t ip6-mcastprefix
841839ff02::1\t ip6-allnodes
842840ff02::2\t ip6-allrouters
843- """
844- )
841+ """ )
845842 if hasattr (self , "bind_mount" ):
846843 self .bind_mount (hosts_file , "/etc/hosts" )
847844
@@ -3046,15 +3043,13 @@ def __init__(
30463043
30473044 hosts_file = os .path .join (self .rundir , "hosts.txt" )
30483045 with open (hosts_file , "w" , encoding = "ascii" ) as hf :
3049- hf .write (
3050- f"""127.0.0.1\t localhost { self .name }
3046+ hf .write (f"""127.0.0.1\t localhost { self .name }
30513047::1\t ip6-localhost ip6-loopback
30523048fe00::0\t ip6-localnet
30533049ff00::0\t ip6-mcastprefix
30543050ff02::1\t ip6-allnodes
30553051ff02::2\t ip6-allrouters
3056- """
3057- )
3052+ """ )
30583053 self .bind_mount (hosts_file , "/etc/hosts" )
30593054
30603055 # Common CLI commands for any topology
@@ -3467,9 +3462,7 @@ async def coverage_finish(self):
34673462
34683463 # Create .gcno symlinks if they don't already exist, for kernel they will
34693464 self .logger .info ("Creating .gcno symlinks from '%s' to '%s'" , gcdadir , bdir )
3470- commander .cmd_raises (
3471- f'cd "{ gcdadir } "; bdir="{ bdir } "'
3472- + """
3465+ commander .cmd_raises (f'cd "{ gcdadir } "; bdir="{ bdir } "' + """
34733466for f in $(find . -name '*.gcda'); do
34743467 f=${f#./};
34753468 f=${f%.gcda}.gcno;
@@ -3478,8 +3471,7 @@ async def coverage_finish(self):
34783471 touch -h -r $bdir/$f $f;
34793472 echo $f;
34803473 fi;
3481- done"""
3482- )
3474+ done""" )
34833475
34843476 # Get the results into a summary file
34853477 data_file = rundir / "coverage.info"
0 commit comments