summaryrefslogtreecommitdiff
path: root/morphlib/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/util.py')
-rw-r--r--morphlib/util.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/morphlib/util.py b/morphlib/util.py
index e171714a..c832a141 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -76,7 +76,7 @@ def make_concurrency(cores=None):
def create_cachedir(settings): # pragma: no cover
- '''Create a new cache directory.'''
+ '''Return cache directory, creating it if necessary.'''
cachedir = settings['cachedir']
if not os.path.exists(cachedir):
@@ -84,21 +84,17 @@ def create_cachedir(settings): # pragma: no cover
return cachedir
-def create_artifact_cachedir(settings): # pragma: no cover
- '''Create a new directory for the local artifact cache.'''
-
- artifact_cachedir = os.path.join(
- settings['cachedir'], 'artifacts')
- if not os.path.exists(artifact_cachedir):
- os.mkdir(artifact_cachedir)
- return artifact_cachedir
+def new_artifact_caches(settings): # pragma: no cover
+ '''Create new objects for local and remote artifact caches.
+ This includes creating the directories on disk, if missing.
-def new_artifact_caches(settings): # pragma: no cover
- '''Create new objects for local, remote artifact caches.'''
+ '''
- create_cachedir(settings)
- artifact_cachedir = create_artifact_cachedir(settings)
+ cachedir = create_cachedir(settings)
+ artifact_cachedir = os.path.join(cachedir, 'artifacts')
+ if not os.path.exists(artifact_cachedir):
+ os.mkdir(artifact_cachedir)
lac = morphlib.localartifactcache.LocalArtifactCache(artifact_cachedir)
@@ -109,6 +105,7 @@ def new_artifact_caches(settings): # pragma: no cover
rac = None
return lac, rac
+
def combine_aliases(app): # pragma: no cover
'''Create a full repo-alias set from the app's settings.'''
trove_host = app.settings['trove-host']