Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore error if directory already exists #47

Merged
merged 2 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ data-sub/
build/
dist/
podaac_data_subscriber.egg-info/
.idea/
.idea/
venv
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Changed
- created library of common access mechanisms to split between subscriber and downloader capabilities
- added .tar.gz to list of default extensions. [40](https://github.com/podaac/data-subscriber/issues/40)
- Ignore error if destination directory already exists. [46](https://github.com/podaac/data-subscriber/issues/46)
### Deprecated
### Removed
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion subscriber/podaac_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def validate(args):

def check_dir(path):
if not isdir(path):
makedirs(path)
makedirs(path, exist_ok=True)


def prepare_time_output(times, prefix, file, args, ts_shift):
Expand Down
2 changes: 1 addition & 1 deletion subscriber/podaac_data_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def run():

if not isdir(data_path):
print("NOTE: Making new data directory at " + data_path + "(This is the first run.)")
makedirs(data_path)
makedirs(data_path, exist_ok=True)

# Change this to whatever extent you need. Format is W Longitude,S Latitude,E Longitude,N Latitude
bounding_extent = args.bbox
Expand Down
2 changes: 1 addition & 1 deletion subscriber/podaac_data_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def run():

if not isdir(data_path):
print("NOTE: Making new data directory at " + data_path + "(This is the first run.)")
makedirs(data_path)
makedirs(data_path, exist_ok=True)
else:
try:
with open(data_path + "/.update", "r") as f:
Expand Down