Skip to content

Commit

Permalink
Merge pull request #1304 from sykim-etri/fix-getimage-in-azure
Browse files Browse the repository at this point in the history
[azure:vm] fix getimage
  • Loading branch information
powerkimhub authored Aug 27, 2024
2 parents 353a7ac + 7083d45 commit 31a47ff
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"context"
"errors"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"
"regexp"
"strconv"
"strings"
"sync"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6"

call "github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/call-log"
idrv "github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/interfaces"
irs "github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/interfaces/resources"
Expand Down Expand Up @@ -497,9 +498,9 @@ func (imageHandler *AzureImageHandler) GetImage(imageIID irs.IID) (irs.ImageInfo
}
LoggingInfo(hiscallInfo, start)

if resp.VirtualMachineImage.Properties != nil &&
if !(resp.VirtualMachineImage.Properties != nil &&
resp.VirtualMachineImage.Properties.OSDiskImage != nil &&
resp.VirtualMachineImage.Properties.OSDiskImage.OperatingSystem != nil {
resp.VirtualMachineImage.Properties.OSDiskImage.OperatingSystem != nil) {
createErr := errors.New(fmt.Sprintf("Failed to Get Image. err = Failed to get image information"))
cblogger.Error(createErr)
LoggingError(hiscallInfo, createErr)
Expand Down

0 comments on commit 31a47ff

Please sign in to comment.