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

Fix a problem adding MSIDs to existing content type #219

Merged
merged 1 commit into from
Mar 25, 2021
Merged
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
9 changes: 8 additions & 1 deletion Ska/engarchive/update_client_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def copy_server_files(opt, logger, copy_files, server_path, copy_func, as_posix=
for copy_file in copy_files:
local_file = Path(opt.data_root, copy_file)
server_file = Path(server_path, copy_file)
logger.debug(f'Local file={local_file}')
logger.debug(f'Server file={server_file}')
if as_posix:
server_file = server_file.as_posix()
local_file.parent.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -294,11 +296,16 @@ def get_copy_files(logger, msids, msids_content):
ft['msid'] = ft_msid
ft['interval'] = interval
pth = Path(msid_files[filetype].abs)
if not pth.exists():
# Copy files that do not exist locally. An exception is the colnames
# file (colnames.pkl), which must get updated even if it exists.
if not pth.exists() or filetype == 'colnames':
copy_files.add(str(pth.relative_to(basedir)))

logger.info(f'Found {len(copy_files)} local archive files that are '
f'missing and need to be copied')
logger.debug(f'Copy_files:')
for copy_file in sorted(copy_files):
logger.debug(copy_file)

return sorted(copy_files)

Expand Down