diff --git a/gga_init.py b/gga_init.py index 1025efa9fb948bf32835cbf3998cba6570f5a8be..b87f3f600ae89662854f2ebe83b3232b972c3678 100755 --- a/gga_init.py +++ b/gga_init.py @@ -38,7 +38,7 @@ class DeploySpeciesStack(speciesData.SpeciesData): """ - def make_directory_tree(self, picture_path): + def make_directory_tree(self): """ Generate the directory tree for an organism @@ -77,18 +77,18 @@ class DeploySpeciesStack(speciesData.SpeciesData): self.config.pop(constants.CONF_TRIPAL_BANNER_PATH, None) # Copy the organism picture for tripal - if picture_path is not None: - if os.path.isfile(picture_path): - picture_path_basename = os.path.basename(picture_path) + if self.picture_path is not None: + if os.path.isfile(self.picture_path): + picture_path_basename = os.path.basename(self.picture_path) picture_path_filename, picture_path_extension = os.path.splitext(picture_path_basename) if picture_path_extension == ".png" or picture_path_extension == ".jpg": picture_dest_name = "species%s" % picture_path_extension picture_dest_path = os.path.join(self.species_dir, picture_dest_name) - shutil.copy(picture_path, picture_dest_path) + shutil.copy(self.picture_path, picture_dest_path) else: - logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(picture_path)) + logging.error("Specified organism picture has wrong extension (must be '.png' or '.jpg'): {0}".format(self.picture_path)) else: - logging.error("Specified organism picture not found {0} for {1}".format(picture_path, self.genus_uppercase + " " + self.species)) + logging.error("Specified organism picture not found {0} for {1}".format(self.picture_path, self.genus_uppercase + " " + self.species)) # Create nginx dirs and write/re-write nginx conf make_dirs(dir_paths_li=["./nginx", "./nginx/conf"]) @@ -423,8 +423,8 @@ if __name__ == "__main__": logging.info("gga_init.py called for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) # Make/update directory tree - picture_path = sp_picture_dict[deploy_stack_for_current_organism.genus_species] - deploy_stack_for_current_organism.make_directory_tree(picture_path) + deploy_stack_for_current_organism.picture_path = sp_picture_dict[deploy_stack_for_current_organism.genus_species] + deploy_stack_for_current_organism.make_directory_tree() logging.info("Successfully generated the directory tree for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) # Make compose files diff --git a/speciesData.py b/speciesData.py index 9020e2cd09691524b963fa2d7245a6dc801abaab..b0d6190faeead7917f8efbb9a4a1341e198d5dc3 100755 --- a/speciesData.py +++ b/speciesData.py @@ -69,7 +69,6 @@ class SpeciesData: self.date = datetime.today().strftime("%Y-%m-%d") self.origin = parameters_dictionary_description[constants.ORG_PARAM_DESC_ORIGIN] self.performed = parameters_dictionary_data[constants.ORG_PARAM_DATA_PERFORMED_BY] - self.picture_path = parameters_dictionary_description[constants.ORG_PARAM_DESC_PICTURE_PATH] if parameters_dictionary_data[constants.ORG_PARAM_DATA_GENOME_VERSION] == "": self.genome_version = "1.0" diff --git a/templates/gspecies_compose.yml.j2 b/templates/gspecies_compose.yml.j2 index b8c9e1be931ef383ff05ca3a3bb709a0561fcbcd..1b1e8f8f692ff0d745dc27448c196bd3dd1ba617 100644 --- a/templates/gspecies_compose.yml.j2 +++ b/templates/gspecies_compose.yml.j2 @@ -42,7 +42,7 @@ services: - ./banner.png:/var/www/html/banner.png:ro {% endif %} #- /groups/XXX/:/groups/XXX/:ro # We do this when we have symlinks in src_data pointing to /groups/XXX/... - {% if 'picture_path' is defined and 'picture_path' != '' %} + {% if 'picture_path' is defined %} {% if 'png' in picture_path %} - ./species.png:/var/www/html/species.png:ro {% endif %}