File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/udev.py.tar
Back
usr/lib/python3/dist-packages/cloudinit/net/udev.py 0000644 00000002660 15030064275 0016351 0 ustar 00 # Copyright (C) 2015 Canonical Ltd. # # Author: Ryan Harper <ryan.harper@canonical.com> # # This file is part of cloud-init. See LICENSE file for license information. def compose_udev_equality(key, value): """Return a udev comparison clause, like `ACTION=="add"`.""" assert key == key.upper() return '%s=="%s"' % (key, value) def compose_udev_attr_equality(attribute, value): """Return a udev attribute comparison clause, like `ATTR{type}=="1"`.""" assert attribute == attribute.lower() return 'ATTR{%s}=="%s"' % (attribute, value) def compose_udev_setting(key, value): """Return a udev assignment clause, like `NAME="eth0"`.""" assert key == key.upper() return '%s="%s"' % (key, value) def generate_udev_rule(interface, mac, driver=None): """Return a udev rule to set the name of network interface with `mac`. The rule ends up as a single line looking something like: SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 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 # vi: ts=4 expandtab syntax=python usr/lib/python3/dist-packages/sos/report/plugins/udev.py 0000644 00000001604 15030064351 0017361 0 ustar 00 # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution for further information. from sos.report.plugins import Plugin, IndependentPlugin class Udev(Plugin, IndependentPlugin): short_desc = 'udev dynamic device management' plugin_name = 'udev' profiles = ('system', 'hardware', 'boot') def setup(self): self.add_copy_spec([ "/etc/udev/udev.conf", "/lib/udev/rules.d", "/etc/udev/rules.d/*" ]) self.add_file_tags({ "/etc/udev/rules.d/70-persistent-net.rules": "udev_persistent_net_rules" }) # vim: set et ts=4 sw=4 :
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings