Merge "Replace use of os.errno.* with errno.*"

This commit is contained in:
Zuul 2018-07-23 11:19:45 +00:00 committed by Gerrit Code Review
commit 4b90b0d8d0
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,7 @@ Requires rootwrap (or equivalent sudo privileges) to execute:
"""
import errno
import glob
import os
import random
@ -349,7 +350,7 @@ class DjbdnsBackend(base.AgentBackend):
os.remove(zone_fn)
LOG.debug('Deleted Zone: %s', zone_name)
except OSError as e:
if os.errno.ENOENT == e.errno:
if errno.ENOENT == e.errno:
LOG.info("Zone datafile %s was already deleted", zone_fn)
return

View File

@ -38,6 +38,7 @@ Supported Knot versions: >= 2.1, < 3
Configured in [service:agent:gdnsd]
"""
import errno
import os
import tempfile
import string
@ -245,7 +246,7 @@ class GdnsdBackend(base.AgentBackend):
os.remove(zone_fn)
LOG.debug('Deleted Zone: %s', zone_name)
except OSError as e:
if os.errno.ENOENT == e.errno:
if errno.ENOENT == e.errno:
LOG.info("Zone datafile %s was already deleted", zone_fn)
return
raise