Skip to content

Commit

Permalink
don't create calib repo if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Pease committed Mar 17, 2017
1 parent 36cc3d4 commit 5b7ef7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/lsst/obs/base/cameraMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,16 @@ def __init__(self, policy, repositoryDir,

# If the calibRoot is passed in, use that. If not and it's indicated in the policy, use that. And
# otherwise, the calibs are in the regular root.
if calibRoot is not None:
# If the location indicated by the calib root does not exist, do not create it.
calibStorage = None
if calibRoot is not None and dafPersist.Storage.storageExists(uri=calibRoot):
calibStorage = dafPersist.Storage.makeFromURI(uri=calibRoot)
elif 'calibRoot' in policy:
calibRoot = policy['calibRoot']
calibRoot = dafPersist.LogicalLocation(calibRoot).locString()
calibStorage = dafPersist.Storage.makeFromURI(uri=calibRoot)
else:
if dafPersist.Storage.exists(uri=calibRoot):
calibStorage = dafPersist.Storage.makeFromURI(uri=calibRoot)
if not calibStorage:
calibStorage = self.rootStorage

self.root = root
Expand Down

0 comments on commit 5b7ef7c

Please sign in to comment.