3636 CHECKSUM_ALGORITHM ,
3737 ExportContainerParameter ,
3838)
39+ from exasol .slc .models .compression_strategy import CompressionStrategy
3940
4041
4142class CheckCacheFileTask (DependencyLoggerBaseTask ):
@@ -170,11 +171,17 @@ def _pack_release_file(
170171 ) -> None :
171172 self .logger .info ("Pack container file %s" , release_file )
172173 extract_content = " " .join (f"'{ file } '" for file in os .listdir (extract_dir ))
173- if not str (release_file ).endswith ("tar.gz" ):
174+ if str (release_file ).endswith ("tar.gz" ):
175+ tmp_release_file = release_file .with_suffix (
176+ ""
177+ ) # cut off ".gz" from ".tar.gz"
178+ elif str (release_file ).endswith ("tar" ):
179+ tmp_release_file = release_file
180+ else :
174181 raise ValueError (
175- f"Unexpected release file: '{ release_file } '. Expected suffix 'tar.gz'."
182+ f"Unexpected release file: '{ release_file } '. Expected suffix: 'tar.gz' or 'tar '."
176183 )
177- tmp_release_file = release_file . with_suffix ( "" ) # cut off ".gz" from ".tar.gz"
184+
178185 command = (
179186 f"""tar -C '{ extract_dir } ' -vcf '{ tmp_release_file } ' { extract_content } """
180187 )
@@ -195,12 +202,19 @@ def _pack_release_file(
195202 log_path .joinpath ("pack_release_file.log" ),
196203 )
197204 shutil .rmtree (extract_dir )
198- command = f"""gzip { tmp_release_file } """
199- self .run_command (
200- command ,
201- f"Creating '{ release_file } '" ,
202- log_path .joinpath ("pack_release_file.log" ),
203- )
205+ if self .compression_strategy == CompressionStrategy .GZIP :
206+ command = f"""gzip { tmp_release_file } """
207+ self .run_command (
208+ command ,
209+ f"Creating '{ release_file } '" ,
210+ log_path .joinpath ("pack_release_file.log" ),
211+ )
212+ elif self .compression_strategy == CompressionStrategy .NONE :
213+ pass
214+ else :
215+ raise ValueError (
216+ f"Unexpected compression_strategy: { self .compression_strategy } "
217+ )
204218
205219 @staticmethod
206220 def _modify_extracted_container (extract_dir : str ) -> None :
0 commit comments