Skip to content

Commit 3a498d7

Browse files
author
Lars Grebe
committed
Added a configuration parameter to enable/disable image status checking via openstack4j libraries openbaton/NFVO#291
1 parent d40226e commit 3a498d7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/main/java/org/openbaton/drivers/openstack4j/OpenStack4JDriver.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ public static void main(String[] args)
276276
private void checkImageStatus(
277277
OSClient os, OpenstackVimInstance openstackVimInstance, String imageId, String imageName)
278278
throws VimException {
279-
280279
log.debug("Retrieved imageId(" + imageId + ") from image with name " + imageName);
281280
org.openstack4j.model.image.Image imageFromVim = os.images().get(imageId);
282281
log.trace(
@@ -300,13 +299,21 @@ else if (imageFromVim.getId() == null) {
300299
} else if (imageV2FromVim.getStatus() == null
301300
|| imageV2FromVim.getStatus()
302301
!= (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+
}
305308
}
306309
} else if (imageFromVim.getStatus() == null
307310
|| 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+
}
310317
}
311318
}
312319

src/main/resources/plugin.conf.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ deallocate-floating-ip=true
3535
wait-for-vm=5000
3636

3737
# ignore ssl verification
38-
disable-ssl-verification = true
38+
disable-ssl-verification = true
39+
40+
# ignore ready status for images
41+
enable-image-status-check = false

0 commit comments

Comments
 (0)