mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
修正:zone-create时候没有region时创建zone失败
This commit is contained in:
@@ -106,6 +106,7 @@ func init() {
|
||||
NameCN string `help:"Name in Chinese"`
|
||||
Desc string `metavar:"<DESCRIPTION>" help:"Description"`
|
||||
Location string `help:"Location"`
|
||||
Region string `help:"Cloudregion in which zone created"`
|
||||
}
|
||||
R(&ZoneCreateOptions{}, "zone-create", "Create a zone", func(s *mcclient.ClientSession, args *ZoneCreateOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
@@ -119,6 +120,9 @@ func init() {
|
||||
if len(args.Location) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Location), "location")
|
||||
}
|
||||
if len(args.Region) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Region), "region")
|
||||
}
|
||||
zone, err := modules.Zones.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user