forked from Mirror/frr
yang: fix race condition in embedmodel.py mkdir
Parallel build may be executing another copy of embedmodel.py at the same time, with both getting "False" on the isdir check, and then both trying to mkdir - one of which will error out. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
d173381edc
commit
05a13c2cd4
|
@ -12,8 +12,10 @@ inname = sys.argv[1]
|
|||
outname = sys.argv[2]
|
||||
|
||||
outdir = os.path.dirname(os.path.abspath(outname))
|
||||
if not os.path.isdir(outdir):
|
||||
try:
|
||||
os.makedirs(outdir)
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
# these are regexes to avoid a compile-time/host dependency on yang-tools
|
||||
# or python-yang. Cross-compiling FRR is already somewhat involved, no need
|
||||
|
|
Loading…
Reference in a new issue