Skip to content

Commit

Permalink
Fix incorrect logger call for CallLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Jan 26, 2025
1 parent 2b75c3d commit fd786e1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func (NLBHandler *AlibabaNLBHandler) ListNLB() ([]*irs.NLBInfo, error) {
return nil, err
}

callogger.Info("result count ", result.TotalCount)
callogger.Info(result)
cblogger.Info("result count ", result.TotalCount)
cblogger.Info(result)
var nlbInfoList []*irs.NLBInfo
for _, curLB := range result.LoadBalancers.LoadBalancer { // LB 목록 조회시 가져오는 값들이 많지 않음. 상세정보는 GetNL로로
nlbInfo, nlbErr := NLBHandler.GetNLB(irs.IID{SystemId: curLB.LoadBalancerId})
Expand Down Expand Up @@ -1459,8 +1459,8 @@ func (NLBHandler *AlibabaNLBHandler) ListIID() ([]*irs.IID, error) {
return iidList, err
}

callogger.Info("result count ", result.TotalCount)
callogger.Info(result)
cblogger.Info("result count ", result.TotalCount)
cblogger.Info(result)

for _, curLB := range result.LoadBalancers.LoadBalancer {
cblogger.Debugf("[%s] NLB information retrieval", curLB.LoadBalancerId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func DescribeVolumnesBySnapshot(svc *ec2.EC2, snapShotIIDs []string) (*ec2.Descr
callLogStart := call.Start()

result, err := svc.DescribeVolumes(input)
callogger.Info("DescribeVolumnesBySnapshot IN PU T")
cblogger.Info("DescribeVolumnesBySnapshot IN PU T")
cblogger.Debug(input)

callLogInfo.ElapsedTime = call.Elapsed(callLogStart)
Expand Down Expand Up @@ -731,8 +731,8 @@ func DescribeRegions(client *ec2.EC2, AllRegionsBool bool, regionName string) (*
resp, err := client.DescribeRegions(RegionsInput)
callLogInfo.ElapsedTime = call.Elapsed(callLogStart)
callogger.Info(call.String(callLogInfo))
callogger.Info("########################")
callogger.Info(resp.Regions)
cblogger.Info("########################")
cblogger.Info(resp.Regions)

if err != nil {
cblogger.Error(err)
Expand Down Expand Up @@ -762,7 +762,7 @@ func DescribeAvailabilityZones(client *ec2.EC2, AllRegionsBool bool) (*ec2.Descr
respZones, err := client.DescribeAvailabilityZones(nil) //ZonesInput
callLogInfo.ElapsedTime = call.Elapsed(callLogStart)
callogger.Info(call.String(callLogInfo))
callogger.Info(respZones.AvailabilityZones)
cblogger.Info(respZones.AvailabilityZones)

if err != nil {
cblogger.Error(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (imageHandler *GCPImageHandler) GetImageN(imageName string) (irs.ImageInfo,
}
}

callogger.Info("image not found at specific project url. try all project.")
cblogger.Info("image not found at specific project url. try all project.")
// if not. query all
for _, imgageProjectId := range arrImageProjectList {
gcpImage, err := imageHandler.Client.Images.Get(imgageProjectId, imageName).Do()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (regionZoneHandler *GCPRegionZoneHandler) ListOrgRegion() (string, error) {
callogger.Info(call.String(callLogInfo))
j, _ := resp.MarshalJSON()

//callogger.Info(j)
//cblogger.Info(j)
return string(j), err
}
func (regionZoneHandler *GCPRegionZoneHandler) ListOrgZone() (string, error) {
Expand Down Expand Up @@ -210,7 +210,7 @@ func (regionZoneHandler *GCPRegionZoneHandler) ListOrgZone() (string, error) {
callogger.Info(call.String(callLogInfo))
j, _ := resp.MarshalJSON()

//callogger.Info(j)
//cblogger.Info(j)
return string(j), err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,23 +728,26 @@ func (vmHandler *GCPVMHandler) RebootVM(vmID irs.IID) (irs.VMStatus, error) {

status, err := vmHandler.GetVMStatus(vmID)
if err != nil {
callogger.Info(err)
cblogger.Error(err)
callLogInfo.ErrorMSG = err.Error()
callogger.Info(call.String(callLogInfo))
return irs.VMStatus("Failed"), err
}
// running 상태일 때는 reset
if status == "Running" {
callogger.Info("Since the VM is in a running state, reset is called.")
cblogger.Info("Since the VM is in a running state, reset is called.")
operation, err := vmHandler.Client.Instances.Reset(projectID, zone, vmID.SystemId).Context(ctx).Do()

if err != nil {
cblogger.Error(err)
cblogger.Info(operation)
callLogInfo.ElapsedTime = call.Elapsed(callLogStart)
callLogInfo.ErrorMSG = err.Error()
callogger.Info(call.String(callLogInfo))
callogger.Info(operation)
return irs.VMStatus("Failed"), err
}
} else if status == "Suspended" {
callogger.Info("Since the VM is in a Suspended state, ResumeVM is called.")
cblogger.Info("Since the VM is in a Suspended state, ResumeVM is called.")
_, err := vmHandler.ResumeVM(vmID)
if err != nil {
return irs.VMStatus("Failed"), err
Expand All @@ -753,8 +756,8 @@ func (vmHandler *GCPVMHandler) RebootVM(vmID irs.IID) (irs.VMStatus, error) {
// running/suspended 이외에는 비정상
return irs.VMStatus("Failed"), errors.New(string("The status of the VM is [" + status + "]."))
}
//callogger.Info(vmID)
//callogger.Info(status)
//cblogger.Info(vmID)
//cblogger.Info(status)

//operationType := 3 // operationZone := 3
//err = WaitOperationComplete(vmHandler.Client, projectID, region, zone, operation.Name, operationType)
Expand Down

0 comments on commit fd786e1

Please sign in to comment.