Skip to content

Commit

Permalink
Added a configuration parameter to enable/disable image status checki…
Browse files Browse the repository at this point in the history
…ng via openstack4j libraries openbaton/NFVO#291
  • Loading branch information
Lars Grebe committed May 9, 2018
1 parent d40226e commit 3a498d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ public static void main(String[] args)
private void checkImageStatus(
OSClient os, OpenstackVimInstance openstackVimInstance, String imageId, String imageName)
throws VimException {

log.debug("Retrieved imageId(" + imageId + ") from image with name " + imageName);
org.openstack4j.model.image.Image imageFromVim = os.images().get(imageId);
log.trace(
Expand All @@ -300,13 +299,21 @@ else if (imageFromVim.getId() == null) {
} else if (imageV2FromVim.getStatus() == null
|| imageV2FromVim.getStatus()
!= (org.openstack4j.model.image.v2.Image.ImageStatus.ACTIVE)) {
throw new VimException(
"Image (name: " + imageName + ") is not yet in active. Try again later...");
if (Boolean.parseBoolean(properties.getProperty("enable-image-status-check", "false"))) {
throw new VimException(
"Image (name: " + imageName + ") is not yet in active. Try again later...");
} else {
log.debug("Disabled check for image status");
}
}
} else if (imageFromVim.getStatus() == null
|| imageFromVim.getStatus() != (org.openstack4j.model.image.Image.Status.ACTIVE)) {
throw new VimException(
"Image (name: " + imageName + ") is not yet in active. Try again later...");
if (Boolean.parseBoolean(properties.getProperty("enable-image-status-check", "false"))) {
throw new VimException(
"Image (name: " + imageName + ") is not yet in active. Try again later...");
} else {
log.debug("Disabled check for image status");
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/plugin.conf.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ deallocate-floating-ip=true
wait-for-vm=5000

# ignore ssl verification
disable-ssl-verification = true
disable-ssl-verification = true

# ignore ready status for images
enable-image-status-check = false

0 comments on commit 3a498d7

Please sign in to comment.