cloudapi: return http error when failing to convert disk customizations
Return an HTTP error with the invalid customization message when the convertDiskCustomizations() function returns an error. Secondary: The conversion was being run twice by mistake. This has also been fixed.
This commit is contained in:
parent
90f05db135
commit
edb9b284d5
1 changed files with 2 additions and 7 deletions
|
|
@ -506,14 +506,9 @@ func (rbp *Blueprint) GetCustomizationsFromBlueprintRequest() (*blueprint.Custom
|
|||
c.RHSM = bpRhsm
|
||||
}
|
||||
|
||||
disk, err := convertDiskCustomizations(rbpc.Disk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c.Disk = disk
|
||||
bpDisk, err := convertDiskCustomizations(rbpc.Disk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, HTTPErrorWithInternal(ErrorInvalidCustomization, err)
|
||||
}
|
||||
c.Disk = bpDisk
|
||||
|
||||
|
|
@ -1085,7 +1080,7 @@ func (request *ComposeRequest) GetBlueprintFromCustomizations() (blueprint.Bluep
|
|||
|
||||
bp.Customizations.Disk, err = convertDiskCustomizations(request.Customizations.Disk)
|
||||
if err != nil {
|
||||
return bp, err
|
||||
return bp, HTTPErrorWithInternal(ErrorInvalidCustomization, err)
|
||||
}
|
||||
|
||||
if cacerts := request.Customizations.Cacerts; cacerts != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue