The name will go away when the function is exited, it does not need to be explicitly deleted. The name does not conflict with any other names in the method, to which it is local. There are no global 'devices'.
Signed-off-by: mulhern amulhern@redhat.com --- blivet/udev.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/blivet/udev.py b/blivet/udev.py index c670e26..a1ff007 100644 --- a/blivet/udev.py +++ b/blivet/udev.py @@ -99,7 +99,7 @@ def udev_resolve_devspec(devspec): if not devspec: return None
- from . import devices as _devices + from . import devices ret = None for dev in udev_get_block_devices(): if devspec.startswith("LABEL="): @@ -110,7 +110,7 @@ def udev_resolve_devspec(devspec): if udev_device_get_uuid(dev) == devspec[5:]: ret = dev break - elif udev_device_get_name(dev) == _devices.devicePathToName(devspec): + elif udev_device_get_name(dev) == devices.devicePathToName(devspec): ret = dev break else: @@ -123,7 +123,6 @@ def udev_resolve_devspec(devspec): ret = dev break
- del _devices if ret: return udev_device_get_name(ret)