File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ def _dry_run_changed(self, change):
478
478
ignore_file_strategy = Enum (
479
479
ExcludesStrategy .values (),
480
480
config = True ,
481
- default_value = ExcludesStrategy .theirs ,
481
+ default_value = ExcludesStrategy .THEIRS . value ,
482
482
help = """
483
483
Strategy to use if an extra ignore file is passed:
484
484
- merge means that the content of the extra ignore file will be merged
@@ -888,7 +888,9 @@ def build(self):
888
888
self .extra_build_kwargs ,
889
889
platform = self .platform ,
890
890
extra_ignore_file = self .extra_ignore_file ,
891
- ignore_file_strategy = self .ignore_file_strategy ,
891
+ ignore_file_strategy = ExcludesStrategy (
892
+ self .ignore_file_strategy
893
+ ),
892
894
):
893
895
if docker_client .string_output :
894
896
self .log .info (l , extra = dict (phase = R2dState .BUILDING ))
Original file line number Diff line number Diff line change 7
7
import sys
8
8
import tarfile
9
9
import textwrap
10
- from enum import StrEnum , auto
10
+ from enum import Enum
11
11
from functools import lru_cache
12
12
13
13
import escapism
206
206
DEFAULT_NB_UID = 1000
207
207
208
208
209
- class ExcludesStrategy (StrEnum ):
210
- theirs = auto ()
211
- ours = auto ()
212
- merge = auto ()
209
+ class ExcludesStrategy (Enum ):
210
+ THEIRS = "theirs"
211
+ OURS = "ours"
212
+ MERGE = "merge"
213
213
214
214
@classmethod
215
215
def values (cls ):
@@ -594,7 +594,7 @@ def build(
594
594
extra_build_kwargs ,
595
595
platform = None ,
596
596
extra_ignore_file = None ,
597
- ignore_file_strategy = ExcludesStrategy .theirs ,
597
+ ignore_file_strategy = ExcludesStrategy .THEIRS ,
598
598
):
599
599
tarf = io .BytesIO ()
600
600
tar = tarfile .open (fileobj = tarf , mode = "w" )
@@ -640,9 +640,9 @@ def _read_excludes(filepath):
640
640
excludes .extend (_read_excludes (ignore_file_name ))
641
641
642
642
if extra_ignore_file is not None :
643
- if ignore_file_strategy == ExcludesStrategy .ours :
643
+ if ignore_file_strategy == ExcludesStrategy .OURS :
644
644
excludes = extra_excludes
645
- elif ignore_file_strategy == ExcludesStrategy .merge :
645
+ elif ignore_file_strategy == ExcludesStrategy .MERGE :
646
646
excludes .extend (extra_excludes )
647
647
else :
648
648
# ignore means that if an ignore file exist, its content is used
You can’t perform that action at this time.
0 commit comments