@@ -276,7 +276,6 @@ public static void main(String[] args)
276
276
private void checkImageStatus (
277
277
OSClient os , OpenstackVimInstance openstackVimInstance , String imageId , String imageName )
278
278
throws VimException {
279
-
280
279
log .debug ("Retrieved imageId(" + imageId + ") from image with name " + imageName );
281
280
org .openstack4j .model .image .Image imageFromVim = os .images ().get (imageId );
282
281
log .trace (
@@ -300,13 +299,21 @@ else if (imageFromVim.getId() == null) {
300
299
} else if (imageV2FromVim .getStatus () == null
301
300
|| imageV2FromVim .getStatus ()
302
301
!= (org .openstack4j .model .image .v2 .Image .ImageStatus .ACTIVE )) {
303
- throw new VimException (
304
- "Image (name: " + imageName + ") is not yet in active. Try again later..." );
302
+ if (Boolean .parseBoolean (properties .getProperty ("enable-image-status-check" , "false" ))) {
303
+ throw new VimException (
304
+ "Image (name: " + imageName + ") is not yet in active. Try again later..." );
305
+ } else {
306
+ log .debug ("Disabled check for image status" );
307
+ }
305
308
}
306
309
} else if (imageFromVim .getStatus () == null
307
310
|| imageFromVim .getStatus () != (org .openstack4j .model .image .Image .Status .ACTIVE )) {
308
- throw new VimException (
309
- "Image (name: " + imageName + ") is not yet in active. Try again later..." );
311
+ if (Boolean .parseBoolean (properties .getProperty ("enable-image-status-check" , "false" ))) {
312
+ throw new VimException (
313
+ "Image (name: " + imageName + ") is not yet in active. Try again later..." );
314
+ } else {
315
+ log .debug ("Disabled check for image status" );
316
+ }
310
317
}
311
318
}
312
319
0 commit comments