1818import yaml
1919
2020from ..features .cname import CName
21- from ..logger import LoggerSetup
2221from .bucket import Bucket
2322
2423
@@ -53,7 +52,7 @@ def __init__(
5352 :since: 0.8.0
5453 """
5554
56- self ._bucket = Bucket (bucket_name , endpoint_url , s3_resource_config )
55+ self ._bucket = Bucket (bucket_name , endpoint_url , s3_resource_config , logger )
5756
5857 @property
5958 def bucket (self ):
@@ -68,8 +67,8 @@ def bucket(self):
6867
6968 def download_to_directory (
7069 self ,
71- cname ,
72- artifacts_dir ,
70+ cname : str ,
71+ artifacts_dir : str | PathLike [ str ] ,
7372 ):
7473 """
7574 Download S3 artifacts to a given directory.
@@ -80,8 +79,7 @@ def download_to_directory(
8079 :since: 0.8.0
8180 """
8281
83- if not isinstance (artifacts_dir , PathLike ):
84- artifacts_dir = Path (artifacts_dir )
82+ artifacts_dir = Path (artifacts_dir )
8583
8684 if not artifacts_dir .is_dir ():
8785 raise RuntimeError (f"Artifacts directory given is invalid: { artifacts_dir } " )
@@ -101,8 +99,8 @@ def download_to_directory(
10199
102100 def upload_from_directory (
103101 self ,
104- cname ,
105- artifacts_dir ,
102+ cname : str ,
103+ artifacts_dir : str | PathLike [ str ] ,
106104 delete_before_push = False ,
107105 ):
108106 """
@@ -115,8 +113,7 @@ def upload_from_directory(
115113 :since: 0.8.0
116114 """
117115
118- if not isinstance (artifacts_dir , PathLike ):
119- artifacts_dir = Path (artifacts_dir )
116+ artifacts_dir = Path (artifacts_dir )
120117
121118 cname_object = CName (cname )
122119
@@ -146,6 +143,9 @@ def upload_from_directory(
146143 f"Release file data and given cname conflict detected: Commit ID { cname_object .commit_id } "
147144 )
148145
146+ if cname_object .version is None :
147+ raise RuntimeError ("CName version could not be determined!" )
148+
149149 commit_hash = release_config .get (UNNAMED_SECTION , "GARDENLINUX_COMMIT_ID_LONG" )
150150
151151 feature_set = release_config .get (UNNAMED_SECTION , "GARDENLINUX_FEATURES" )
0 commit comments