From df815ac5f41ee519f41fcd644319e4bf6e34938e Mon Sep 17 00:00:00 2001 From: Brianna Smart Date: Mon, 6 Nov 2023 16:33:01 -0800 Subject: [PATCH] Update schema directory generation --- python/lsst/alert/packet/updateSchema.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/lsst/alert/packet/updateSchema.py b/python/lsst/alert/packet/updateSchema.py index 9320dd6..358a2d7 100644 --- a/python/lsst/alert/packet/updateSchema.py +++ b/python/lsst/alert/packet/updateSchema.py @@ -33,8 +33,11 @@ def write_schema(schema, version, path): updated_schema_loc=path[0:-3] + version[0]+'/'+version[2] if not os.path.exists(updated_schema_loc): - os.mkdir(updated_schema_loc[0:-2]) - os.mkdir(updated_schema_loc) + if not os.path.exists(updated_schema_loc[0:-2]): + os.mkdir(updated_schema_loc[0:-2]) + os.mkdir(updated_schema_loc) + else: + os.mkdir(updated_schema_loc) updated_schema_name = schema['namespace'] + '.' + schema['name'] + '.avsc'