mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: 修复openstack存储同步问题
This commit is contained in:
@@ -38,4 +38,23 @@ func init() {
|
||||
printList(storages, 0, 0, 0, []string{})
|
||||
return nil
|
||||
})
|
||||
|
||||
type CinderServiceListOptions struct {
|
||||
REGION string `help:"Region Name"`
|
||||
ZONE string `help:"Zone Name"`
|
||||
}
|
||||
|
||||
shellutils.R(&CinderServiceListOptions{}, "cinder-service-list", "List cinder services", func(cli *openstack.SRegion, args *CinderServiceListOptions) error {
|
||||
izone, err := cli.GetIZoneById(fmt.Sprintf("%s/%s/%s", openstack.CLOUD_PROVIDER_OPENSTACK, args.REGION, args.ZONE))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
zone := izone.(*openstack.SZone)
|
||||
services, err := zone.GetCinderServices()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(services, 0, 0, 0, []string{})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user