From bae1eeaa58b129e7b4542d53a1dba3f8618b879d Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 3 Dec 2018 10:30:26 +0000 Subject: [PATCH] pkg/{aws,azure,qcloud}: fix compilation --- pkg/util/aws/shell/instance.go | 3 ++- pkg/util/azure/shell/instance.go | 5 +++-- pkg/util/qcloud/shell/disk.go | 3 ++- pkg/util/qcloud/shell/eip.go | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/util/aws/shell/instance.go b/pkg/util/aws/shell/instance.go index 64951e8935..a91c02b688 100644 --- a/pkg/util/aws/shell/instance.go +++ b/pkg/util/aws/shell/instance.go @@ -1,6 +1,7 @@ package shell import ( + "context" "fmt" "io/ioutil" @@ -134,7 +135,7 @@ func init() { } shellutils.R(&InstanceRebuildRootOptions{}, "instance-rebuild-root", "Reinstall virtual server system image", func(cli *aws.SRegion, args *InstanceRebuildRootOptions) error { - diskID, err := cli.ReplaceSystemDisk(args.ID, args.Image, args.Size) + diskID, err := cli.ReplaceSystemDisk(context.Background(), args.ID, args.Image, args.Size) if err != nil { return err } diff --git a/pkg/util/azure/shell/instance.go b/pkg/util/azure/shell/instance.go index 9013ae394a..f16ce10b89 100644 --- a/pkg/util/azure/shell/instance.go +++ b/pkg/util/azure/shell/instance.go @@ -1,6 +1,7 @@ package shell import ( + "context" "fmt" "yunion.io/x/onecloud/pkg/util/azure" @@ -138,7 +139,7 @@ func init() { } shellutils.R(&InstanceConfigOptions{}, "instance-change-conf", "Attach a disk to intance", func(cli *azure.SRegion, args *InstanceConfigOptions) error { - return cli.ChangeVMConfig(args.ID, args.NCPU, args.MEMERY) + return cli.ChangeVMConfig(context.Background(), args.ID, args.NCPU, args.MEMERY) }) type InstanceDeployOptions struct { @@ -148,7 +149,7 @@ func init() { } shellutils.R(&InstanceDeployOptions{}, "instance-reset-password", "Reset intance password", func(cli *azure.SRegion, args *InstanceDeployOptions) error { - return cli.DeployVM(args.ID, "", args.Password, args.PublicKey, false, "") + return cli.DeployVM(context.Background(), args.ID, "", args.Password, args.PublicKey, false, "") }) type InstanceSecurityGroupOptions struct { diff --git a/pkg/util/qcloud/shell/disk.go b/pkg/util/qcloud/shell/disk.go index 70f8e2dacb..ac4f50c038 100644 --- a/pkg/util/qcloud/shell/disk.go +++ b/pkg/util/qcloud/shell/disk.go @@ -1,6 +1,7 @@ package shell import ( + "context" "fmt" "yunion.io/x/onecloud/pkg/util/qcloud" @@ -64,7 +65,7 @@ func init() { SIZE int64 `help:"Disk Size GB"` } shellutils.R(&DiskResizeOptions{}, "disk-resize", "Resize disk", func(cli *qcloud.SRegion, args *DiskResizeOptions) error { - return cli.ResizeDisk(args.ID, args.SIZE) + return cli.ResizeDisk(context.Background(), args.ID, args.SIZE) }) type DiskResetOptions struct { diff --git a/pkg/util/qcloud/shell/eip.go b/pkg/util/qcloud/shell/eip.go index ae6cb1f0db..138845c30f 100644 --- a/pkg/util/qcloud/shell/eip.go +++ b/pkg/util/qcloud/shell/eip.go @@ -12,7 +12,7 @@ func init() { Limit int `help:"List limit"` } shellutils.R(&EipListOptions{}, "eip-list", "List eips", func(cli *qcloud.SRegion, args *EipListOptions) error { - eips, total, err := cli.GetEips(args.Eip, args.Offset, args.Limit) + eips, total, err := cli.GetEips(args.Eip, "", args.Offset, args.Limit) if err != nil { return err }