@@ -106,6 +106,7 @@ def released_image(
106
106
* ,
107
107
arch : str = "x86_64" ,
108
108
image_type : ImageType = ImageType .GENERIC ,
109
+ include_deprecated : bool = False ,
109
110
** kwargs ,
110
111
):
111
112
"""Find the id of the latest released image for a particular release.
@@ -121,7 +122,11 @@ def released_image(
121
122
"""
122
123
self ._log .debug ("finding released Ubuntu image for %s" , release )
123
124
image = self ._find_latest_image (
124
- release = release , arch = arch , image_type = image_type , daily = False
125
+ release = release ,
126
+ arch = arch ,
127
+ image_type = image_type ,
128
+ daily = False ,
129
+ include_deprecated = include_deprecated ,
125
130
)
126
131
return image ["ImageId" ]
127
132
@@ -186,7 +191,12 @@ def _get_search_filters(
186
191
]
187
192
188
193
def _find_latest_image (
189
- self , release : str , arch : str , image_type : ImageType , daily : bool
194
+ self ,
195
+ release : str ,
196
+ arch : str ,
197
+ image_type : ImageType ,
198
+ daily : bool ,
199
+ include_deprecated : bool = False ,
190
200
):
191
201
filters = self ._get_search_filters (
192
202
release = release , arch = arch , image_type = image_type , daily = daily
@@ -196,6 +206,7 @@ def _find_latest_image(
196
206
images = self .client .describe_images (
197
207
Owners = [owner ],
198
208
Filters = filters ,
209
+ IncludeDeprecated = include_deprecated ,
199
210
)
200
211
201
212
if not images .get ("Images" ):
@@ -213,6 +224,7 @@ def daily_image(
213
224
* ,
214
225
arch : str = "x86_64" ,
215
226
image_type : ImageType = ImageType .GENERIC ,
227
+ include_deprecated : bool = False ,
216
228
** kwargs ,
217
229
):
218
230
"""Find the id of the latest daily image for a particular release.
@@ -227,7 +239,11 @@ def daily_image(
227
239
"""
228
240
self ._log .debug ("finding daily Ubuntu image for %s" , release )
229
241
image = self ._find_latest_image (
230
- release = release , arch = arch , image_type = image_type , daily = True
242
+ release = release ,
243
+ arch = arch ,
244
+ image_type = image_type ,
245
+ daily = True ,
246
+ include_deprecated = include_deprecated ,
231
247
)
232
248
return image ["ImageId" ]
233
249
0 commit comments