From 805d1aedb874ef5dc9a659b2491f424e5eefe3d4 Mon Sep 17 00:00:00 2001 From: raccoon-pi Date: Thu, 11 Jan 2024 04:38:39 +0000 Subject: [PATCH] rootPath hardcoded remove and interface input value name fix --- .../drivers/alibaba/main/conf/Test_Config.go | 13 +++++-------- .../cloud-driver/drivers/aws/main/Test_Resources.go | 1 + .../interfaces/resources/PriceInfoHandler.go | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cloud-control-manager/cloud-driver/drivers/alibaba/main/conf/Test_Config.go b/cloud-control-manager/cloud-driver/drivers/alibaba/main/conf/Test_Config.go index acff7548e..d2a706b7b 100644 --- a/cloud-control-manager/cloud-driver/drivers/alibaba/main/conf/Test_Config.go +++ b/cloud-control-manager/cloud-driver/drivers/alibaba/main/conf/Test_Config.go @@ -12,6 +12,7 @@ package AliTestConfig import ( "io/ioutil" + "os" alidrv "github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/drivers/alibaba" idrv "github.com/cloud-barista/cb-spider/cloud-control-manager/cloud-driver/interfaces" @@ -66,14 +67,10 @@ type Config struct { // 환경변수 CBSPIDER_PATH 설정 후 해당 폴더 하위에 /config/config.yaml 파일 생성해야 함. func ReadConfigFile() Config { // Set Environment Value of Project Root Path - ///////// rootPath := os.Getenv("CBSPIDER_PATH") - //rootpath := "D:/Workspace/mcloud-barista-config" - // /mnt/d/Workspace/mcloud-barista-config/config/config.yaml - ///////// cblogger.Debugf("Test Data 설정파일 : [%]", rootPath+"/config/config.yaml") - - ///////// data, err := ioutil.ReadFile(rootPath + "/config/config.yaml") - data, err := ioutil.ReadFile("/home/ubuntu/workspace/cb-spider/feature_priceInfo_ali_20231204_yhnoh/cloud-control-manager/cloud-driver/drivers/alibaba/main/Sample/config/config.yaml") - //data, err := ioutil.ReadFile("D:/Workspace/mcloud-bar-config/config/config.yaml") + rootPath := os.Getenv("CBSPIDER_PATH") + cblogger.Debugf("Test Data 설정파일 : [%s]", rootPath+"/config/config.yaml") + data, err := ioutil.ReadFile(rootPath + "/config/config.yaml") + if err != nil { panic(err) } diff --git a/cloud-control-manager/cloud-driver/drivers/aws/main/Test_Resources.go b/cloud-control-manager/cloud-driver/drivers/aws/main/Test_Resources.go index 984549345..43a39aeb3 100644 --- a/cloud-control-manager/cloud-driver/drivers/aws/main/Test_Resources.go +++ b/cloud-control-manager/cloud-driver/drivers/aws/main/Test_Resources.go @@ -13,6 +13,7 @@ package main import ( "fmt" "io/ioutil" + "os" "github.com/aws/aws-sdk-go/aws/awserr" diff --git a/cloud-control-manager/cloud-driver/interfaces/resources/PriceInfoHandler.go b/cloud-control-manager/cloud-driver/interfaces/resources/PriceInfoHandler.go index 198e3a370..bb356236f 100644 --- a/cloud-control-manager/cloud-driver/interfaces/resources/PriceInfoHandler.go +++ b/cloud-control-manager/cloud-driver/interfaces/resources/PriceInfoHandler.go @@ -80,6 +80,6 @@ type PricingPolicyInfo struct { } type PriceInfoHandler interface { - ListProductFamily(targetRegion string) ([]string, error) + ListProductFamily(regionName string) ([]string, error) GetPriceInfo(productFamily string, regionName string, filterList []KeyValue) (string, error) // return string: json format }