Fix for Support selection of datastore for dynamic provisioning in vSphere

This commit is contained in:
Balu Dontu
2017-02-16 16:12:01 -08:00
committed by Ritesh H Shukla
parent b201ac2f8f
commit 12f75f0b86
83 changed files with 8640 additions and 504 deletions

View File

@@ -17,12 +17,12 @@ limitations under the License.
package session
import (
"context"
"sync"
"time"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/soap"
"golang.org/x/net/context"
)
type keepAlive struct {

View File

@@ -17,16 +17,29 @@ limitations under the License.
package session
import (
"context"
"net/url"
"os"
"github.com/vmware/govmomi/property"
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
"golang.org/x/net/context"
)
// Locale defaults to "en_US" and can be overridden via this var or the GOVMOMI_LOCALE env var.
// A value of "_" uses the server locale setting.
var Locale = os.Getenv("GOVMOMI_LOCALE")
func init() {
if Locale == "_" {
Locale = ""
} else if Locale == "" {
Locale = "en_US"
}
}
type Manager struct {
client *vim25.Client
userSession *types.UserSession
@@ -44,9 +57,20 @@ func (sm Manager) Reference() types.ManagedObjectReference {
return *sm.client.ServiceContent.SessionManager
}
func (sm *Manager) SetLocale(ctx context.Context, locale string) error {
req := types.SetLocale{
This: sm.Reference(),
Locale: locale,
}
_, err := methods.SetLocale(ctx, sm.client, &req)
return err
}
func (sm *Manager) Login(ctx context.Context, u *url.Userinfo) error {
req := types.Login{
This: sm.Reference(),
This: sm.Reference(),
Locale: Locale,
}
if u != nil {