Skip to content

Commit

Permalink
BF: TODO for replace logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Sep 1, 2016
1 parent 244ba44 commit 184641f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions datalad/distribution/create_publication_target_sshwebserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,22 @@ def __call__(sshurl, target=None, target_dir=None,
"Target directory %s already exists." % path)
elif existing == 'skip':
continue
elif existing == 'replace' or existing == 'reconfigure':
elif existing == 'replace':
# TODO REMOVE IT!
raise NotImplementedError("rm it!")
path_exists = False # if we succeeded removing it
elif existing == 'reconfigure':
pass
else:
raise ValueError("Do not know how to hand existing=%s" % repr(existing))

try:
ssh(["mkdir", "-p", path])
except CommandError as e:
lgr.error("Remotely creating target directory failed at "
"%s.\nError: %s" % (path, exc_str(e)))
continue
if not path_exists:
try:
ssh(["mkdir", "-p", path])
except CommandError as e:
lgr.error("Remotely creating target directory failed at "
"%s.\nError: %s" % (path, exc_str(e)))
continue

# don't (re-)initialize dataset if existing == reconfigure
if existing != 'reconfigure':
Expand Down

0 comments on commit 184641f

Please sign in to comment.