diff options
Diffstat (limited to 'cloudinit/net/udev.py')
-rw-r--r-- | cloudinit/net/udev.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/cloudinit/net/udev.py b/cloudinit/net/udev.py index 58c0a708..b79e4426 100644 --- a/cloudinit/net/udev.py +++ b/cloudinit/net/udev.py @@ -32,15 +32,18 @@ def generate_udev_rule(interface, mac, driver=None): ATTR{address}="ff:ee:dd:cc:bb:aa", NAME="eth0" """ if not driver: - driver = '?*' - - rule = ', '.join([ - compose_udev_equality('SUBSYSTEM', 'net'), - compose_udev_equality('ACTION', 'add'), - compose_udev_equality('DRIVERS', driver), - compose_udev_attr_equality('address', mac), - compose_udev_setting('NAME', interface), - ]) - return '%s\n' % rule + driver = "?*" + + rule = ", ".join( + [ + compose_udev_equality("SUBSYSTEM", "net"), + compose_udev_equality("ACTION", "add"), + compose_udev_equality("DRIVERS", driver), + compose_udev_attr_equality("address", mac), + compose_udev_setting("NAME", interface), + ] + ) + return "%s\n" % rule + # vi: ts=4 expandtab syntax=python |