Пример #1
0
 def _verify_archive(archive_path):
     wagons = files_in_folder(archive_path, '*.wgn')
     yamls = files_in_folder(archive_path, '*.yaml')
     if len(wagons) != 1 or len(yamls) != 1:
         raise RuntimeError("Archive must include one wgn file "
                            "and one yaml file")
     return wagons[0], yamls[0]
 def _verify_archive(archive_path):
     wagons = files_in_folder(archive_path, '*.wgn')
     yamls = files_in_folder(archive_path, '*.yaml')
     if len(wagons) != 1 or len(yamls) != 1:
         raise RuntimeError("Archive must include one wgn file "
                            "and one yaml file")
     return wagons[0], yamls[0]
Пример #3
0
 def yaml_file_path(self):
     plugin_dir = path.join(config.instance.file_server_root,
                            FILE_SERVER_PLUGINS_FOLDER, self.id)
     if not path.isdir(plugin_dir):
         return None
     yaml_files = files_in_folder(plugin_dir, '*.yaml')
     return yaml_files[0] if yaml_files else None
 def yaml_file_path(self):
     plugin_dir = path.join(config.instance.file_server_root,
                            FILE_SERVER_PLUGINS_FOLDER,
                            self.id)
     if not path.isdir(plugin_dir):
         return None
     yaml_files = files_in_folder(plugin_dir, '*.yaml')
     return yaml_files[0] if yaml_files else None