feat: copy the 1wg files to so... many... places... (#8347)
This commit is contained in:
parent
1fb70d817f
commit
fdd378390f
|
@ -43,23 +43,28 @@ def generate_wg_charters_files_task():
|
|||
encoding="utf8",
|
||||
)
|
||||
|
||||
charter_copy_dest = getattr(settings, "CHARTER_COPY_PATH", None)
|
||||
if charter_copy_dest is not None:
|
||||
if not Path(charter_copy_dest).is_dir():
|
||||
log.log(
|
||||
f"Error copying 1wg-charter files to {charter_copy_dest}: it does not exist or is not a directory"
|
||||
)
|
||||
else:
|
||||
try:
|
||||
shutil.copy2(charters_file, charter_copy_dest)
|
||||
except IOError as err:
|
||||
log.log(f"Error copying {charters_file} to {charter_copy_dest}: {err}")
|
||||
try:
|
||||
shutil.copy2(charters_by_acronym_file, charter_copy_dest)
|
||||
except IOError as err:
|
||||
charter_copy_dests = [
|
||||
getattr(settings, "CHARTER_COPY_PATH", None),
|
||||
getattr(settings, "CHARTER_COPY_OTHER_PATH", None),
|
||||
getattr(settings, "CHARTER_COPY_THIRD_PATH", None),
|
||||
]
|
||||
for charter_copy_dest in charter_copy_dests:
|
||||
if charter_copy_dest is not None:
|
||||
if not Path(charter_copy_dest).is_dir():
|
||||
log.log(
|
||||
f"Error copying {charters_by_acronym_file} to {charter_copy_dest}: {err}"
|
||||
f"Error copying 1wg-charter files to {charter_copy_dest}: it does not exist or is not a directory"
|
||||
)
|
||||
else:
|
||||
try:
|
||||
shutil.copy2(charters_file, charter_copy_dest)
|
||||
except IOError as err:
|
||||
log.log(f"Error copying {charters_file} to {charter_copy_dest}: {err}")
|
||||
try:
|
||||
shutil.copy2(charters_by_acronym_file, charter_copy_dest)
|
||||
except IOError as err:
|
||||
log.log(
|
||||
f"Error copying {charters_by_acronym_file} to {charter_copy_dest}: {err}"
|
||||
)
|
||||
|
||||
|
||||
@shared_task
|
||||
|
|
|
@ -62,6 +62,8 @@ class GroupPagesTests(TestCase):
|
|||
settings_temp_path_overrides = TestCase.settings_temp_path_overrides + [
|
||||
"CHARTER_PATH",
|
||||
"CHARTER_COPY_PATH",
|
||||
"CHARTER_COPY_OTHER_PATH", # Note: not explicitly testing use of
|
||||
"CHARTER_COPY_THIRD_PATH", # either of these settings
|
||||
"GROUP_SUMMARY_PATH",
|
||||
]
|
||||
|
||||
|
|
|
@ -744,6 +744,8 @@ INTERNET_DRAFT_PDF_PATH = '/a/www/ietf-datatracker/pdf/'
|
|||
RFC_PATH = '/a/www/ietf-ftp/rfc/'
|
||||
CHARTER_PATH = '/a/ietfdata/doc/charter/'
|
||||
CHARTER_COPY_PATH = '/a/www/ietf-ftp/ietf' # copy 1wg-charters files here if set
|
||||
CHARTER_COPY_OTHER_PATH = '/a/www/ftp/ietf'
|
||||
CHARTER_COPY_THIRD_PATH = '/a/www/ftp/charter'
|
||||
GROUP_SUMMARY_PATH = '/a/www/ietf-ftp/ietf'
|
||||
BOFREQ_PATH = '/a/ietfdata/doc/bofreq/'
|
||||
CONFLICT_REVIEW_PATH = '/a/ietfdata/doc/conflict-review'
|
||||
|
|
Loading…
Reference in a new issue