[PATCH pykickstart rhel7-branch?] Add support for network team devices (#1003591)

Brian C. Lane bcl at redhat.com
Fri Nov 8 01:57:01 UTC 2013


On Wed, Nov 06, 2013 at 11:02:14AM +0100, Radek Vykydal wrote:
> +        cmd = "network --device team0 --bootproto static --ip=10.34.102.222 --netmask=255.255.255.0 --gateway=10.34.102.254 --nameserver=10.34.39.2 --teamslaves=\"p3p1'{\\\"prio\\\": -10, \\\"sticky\\\": true}',p3p2'{\\\"prio\\\": 100}'\" --teamconfig=\"{\\\"runner\\\": {\\\"name\\\": \\\"activebackup\\\"}}\" --activate"
> +        self.assert_parse(cmd)
> +
> +        cmd = "network --device team0 --bootproto dhcp --teamslaves=p3p1,p3p2 --teamconfig=\"{\\\"runner\\\": {\\\"name\\\": \\\"roundrobin\\\"}}\" --activate"
> +        self.assert_parse(cmd)
> +
> +        # --teamslaves
> +        # --teamslaves="<DEV1>['<CONFIG1>'],<DEV2>['<CONFIG2>'],..."
> +        # CONFIGX is json with " escaped to \"
> +
> +        teamslaves_strings = [
> +            "eth1,eth2",
> +            "eth1,eth2'{\\\"prio\\\": 100}'",
> +            "eth1'{\\\"prio\\\": -10, \\\"sticky\\\": true}',eth2",
> +            "eth1'{\\\"prio\\\": -10, \\\"sticky\\\": true}',eth2'{\\\"prio\\\": 100}'",
> +            "eth1,eth2,eth3",
> +            "eth1,eth2'{\\\"prio\\\": 100}',eth3",

All these escapes might be a bit more readable if you use r"" so you can
drop escaping the escape :)

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list