Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(provider/openstack): Use directUrl property for image location #2912

Merged
merged 1 commit into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OpenstackImageV2Provider implements OpenstackImageProvider, OpenstackReque
.id(image.id)
.status(image.status?.value())
.size(image.size)
.location(image.locations?.get(0)?.toString())
.location(image.directUrl)
.createdAt(image.createdAt?.time)
.updatedAt(image.updatedAt?.time)
.properties(properties)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import org.openstack4j.api.image.v2.ImageService
import org.openstack4j.model.image.v2.Image
import org.springframework.http.HttpStatus

class OpenstackImageV1ClientProviderSpec extends OpenstackClientProviderSpec {
class OpenstackImageV2ClientProviderSpec extends OpenstackClientProviderSpec {

def "list images succeeds"() {
setup:
Map<String, String> filters = null
ImageService imageService = Mock(ImageService)
def imageLocation = "http://example.com/image.iso"
Image image = Mock(Image) {
getLocations() >> [imageLocation]
getDirectUrl() >> imageLocation
}

when:
Expand Down