We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4f853aa + 881eb00 commit efef91bCopy full SHA for efef91b
osia/installer/downloader/image.py
@@ -84,5 +84,13 @@ def download_image(image_url: str, image_file: str):
84
"""Main entrypoint for image download, function
85
extracts url to rhcos image, downloads and extracts it
86
to specified target"""
87
+ directory = Path(image_file).parent
88
+ # Check if the directory exists
89
+ if not directory.exists():
90
+ # If the directory does not exist, create it
91
+ directory.mkdir(parents=True)
92
+ logging.debug("Creating %s directory for download images", directory)
93
+ else:
94
+ logging.debug("Directory %s for images already exists", directory)
95
res_file = get_data(image_url, image_file, _extract_gzip)
96
return res_file
0 commit comments