From f462fc2c81b7cad15acb2da630c69114b30ef3d9 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Nov 01 2018 17:03:05 +0000 Subject: Create the directories while creating ostree ref if not exist Signed-off-by: Sayan Chowdhury --- diff --git a/robosignatory/work.py b/robosignatory/work.py index 8b70458..9e7e813 100644 --- a/robosignatory/work.py +++ b/robosignatory/work.py @@ -47,6 +47,11 @@ def process_atomic(signer, ref, commitid, key, directory, doref=True): log.info('Previous commit for %s: %s' % (ref, f.read().replace('\n', ''))) + basename_refpath = os.path.basename(refpath) + if doref and not os.path.exists(basename_refpath): + log.info("Creating the directories for the refpath") + os.makedirs(basename_refpath) + if doref: log.info('Writing %s to %s' % (commitid, refpath))