// Open is part of the ContainerEnvironProvider interface.
427239
func (p kubernetesEnvironProvider) Open(args environs.OpenParams) (caas.Broker, error) {
	logger.Debugf("opening model %q.", args.Config.Name())
	if err := p.validateCloudSpec(args.Cloud); err != nil {
		return nil, errors.Annotate(err, "validating cloud spec")
	}
	k8sRestConfig, err := cloudSpecToK8sRestConfig(args.Cloud)
	if err != nil {
		return nil, errors.Trace(err)
	}
	broker, err := NewK8sBroker(
		args.ControllerUUID, k8sRestConfig, args.Config, newK8sClient, newKubernetesWatcher, jujuclock.WallClock,
	)
	if err != nil {
		return nil, err
	}
	return controllerCorelation(broker)
}
1233215
func (us *UnionScanExec) Open(ctx context.Context) error {
	if err := us.baseExecutor.Open(ctx); err != nil {
		return err
	}
	us.snapshotChunkBuffer = us.newFirstChunk()
	return nil
}
989616
func (tpc *TwoPC) Open(dbconfigs *dbconfigs.DBConfigs) {
	tpc.readPool.Open(dbconfigs.AppWithDB(), dbconfigs.DbaWithDB(), dbconfigs.DbaWithDB())
}
1020536
func (s *Server) Open() error {
	opts := stand.GetDefaultOptions()
	opts.StoreType = stores.TypeFile
	opts.ID = ServerName
	opts.FilestoreDir = s.config.FilestoreDir
	server, err := stand.RunServerWithOpts(opts, nil)
	if err != nil {
		return err
	}

	s.Server = server

	return nil
}
886505
func (l *httpFileSystemLoader) Open(name string) (io.ReadCloser, error) {
	if l.fs == nil {
		return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist}
	}
	return l.fs.Open(name)
}
1342605
func (env *Env) Open(path string, flags uint, mode os.FileMode) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ret := C.mdb_env_open(env._env, cpath, C.uint(NoTLS|flags), C.mdb_mode_t(mode))
	return operrno("mdb_env_open", ret)
}
637082
func Open(location string) (*Lowlevel, error) {
	opts := &opt.Options{
		OpenFilesCacheCapacity: dbMaxOpenFiles,
		WriteBuffer:            dbWriteBuffer,
	}
	return open(location, opts)
}
1188901
func (prov *azureEnvironProvider) Open(args environs.OpenParams) (environs.Environ, error) {
	logger.Debugf("opening model %q", args.Config.Name())
	if err := validateCloudSpec(args.Cloud); err != nil {
		return nil, errors.Annotate(err, "validating cloud spec")
	}
	environ, err := newEnviron(prov, args.Cloud, args.Config)
	if err != nil {
		return nil, errors.Annotate(err, "opening model")
	}
	return environ, nil
}
670997
func (b *Broker) open() redis.Conn {
	b.redisOnce.Do(func() {
		b.pool = b.NewPool(b.socketPath, b.host, b.password, b.db, b.GetConfig().Redis, b.GetConfig().TLSConfig)
		b.redsync = redsync.New([]redsync.Pool{b.pool})
	})

	return b.pool.Get()
}
970246
func (d Datastore) Open(ctx context.Context, name string) (*DatastoreFile, error) {
	return &DatastoreFile{
		d:      d,
		name:   name,
		length: -1,
		ctx:    ctx,
	}, nil
}
645209
func (connector *MultiConnector) Open(path string) (repo Repository, err error) {
	for _, adapter := range connector.conns {
		if adapter.IsSupportRepo(path) {
			return adapter.Open(path)
		}
	}
	return nil, fmt.Errorf("Unsupported repository in path %v (no match any ConnectorAdapter for it)", path)
}
1233226
func Open(cfg RawConfig) (*Client, error) {
	client, err := OpenForSender(cfg, &senderOpener{})
	return client, errors.Trace(err)
}
422421
func (e *baseExecutor) Open(ctx context.Context) error {
	for _, child := range e.children {
		err := child.Open(ctx)
		if err != nil {
			return err
		}
	}
	return nil
}
135365
func (c *Compactor) Open() {
	c.mu.Lock()
	defer c.mu.Unlock()
	if c.snapshotsEnabled || c.compactionsEnabled {
		return
	}

	c.snapshotsEnabled = true
	c.compactionsEnabled = true
	c.snapshotsInterrupt = make(chan struct{})
	c.compactionsInterrupt = make(chan struct{})
	c.snapshotLatencies = &latencies{values: make([]time.Duration, 4)}

	c.files = make(map[string]struct{})
}
1018575
func (l loader) Open(ctx context.Context, path string) (backend.RCS, error) {
	return New(), nil
}
673824
func (image *Image) Open(args ...interface{}) error {
	var c_image C.rbd_image_t
	var c_name *C.char = C.CString(image.name)
	var c_snap_name *C.char
	var ret C.int
	var read_only bool = false

	defer C.free(unsafe.Pointer(c_name))
	for _, arg := range args {
		switch t := arg.(type) {
		case string:
			if t != "" {
				c_snap_name = C.CString(t)
				defer C.free(unsafe.Pointer(c_snap_name))
			}
		case bool:
			read_only = t
		default:
			return errors.New("Unexpected argument")
		}
	}

	if read_only {
		ret = C.rbd_open_read_only(C.rados_ioctx_t(image.ioctx.Pointer()), c_name,
			&c_image, c_snap_name)
	} else {
		ret = C.rbd_open(C.rados_ioctx_t(image.ioctx.Pointer()), c_name,
			&c_image, c_snap_name)
	}

	image.image = c_image

	return GetError(ret)
}
498029
func (e *EnvironProvider) Open(params environs.OpenParams) (environs.Environ, error) {
	logger.Infof("opening model %q", params.Config.Name())

	if err := validateCloudSpec(params.Cloud); err != nil {
		return nil, errors.Trace(err)
	}

	creds := params.Cloud.Credential.Attributes()
	jujuConfig := common.JujuConfigProvider{
		Key:         []byte(creds["key"]),
		Fingerprint: creds["fingerprint"],
		Passphrase:  creds["pass-phrase"],
		Tenancy:     creds["tenancy"],
		User:        creds["user"],
		OCIRegion:   creds["region"],
	}
	provider, err := jujuConfig.Config()
	if err != nil {
		return nil, errors.Trace(err)
	}
	compute, err := ociCore.NewComputeClientWithConfigurationProvider(provider)
	if err != nil {
		return nil, errors.Trace(err)
	}

	networking, err := ociCore.NewVirtualNetworkClientWithConfigurationProvider(provider)
	if err != nil {
		return nil, errors.Trace(err)
	}

	storage, err := ociCore.NewBlockstorageClientWithConfigurationProvider(provider)
	if err != nil {
		return nil, errors.Trace(err)
	}

	identity, err := ociIdentity.NewIdentityClientWithConfigurationProvider(provider)
	if err != nil {
		return nil, errors.Trace(err)
	}

	env := &Environ{
		Compute:    compute,
		Networking: networking,
		Storage:    storage,
		Firewall:   networking,
		Identity:   identity,
		ociConfig:  provider,
		clock:      clock.WallClock,
		p:          e,
	}

	if err := env.SetConfig(params.Config); err != nil {
		return nil, err
	}

	env.namespace, err = instance.NewNamespace(env.Config().UUID())

	cfg := env.ecfg()
	if cfg.compartmentID() == nil {
		return nil, errors.New("compartment-id may not be empty")
	}

	addressSpace := cfg.addressSpace()
	if _, ipNET, err := net.ParseCIDR(*addressSpace); err == nil {
		size, _ := ipNET.Mask.Size()
		if size > 16 {
			return nil, errors.Errorf("configured subnet (%q) is not large enough. Please use a prefix length in the range /8 to /16. Current prefix length is /%d", *addressSpace, size)
		}
	} else {
		return nil, errors.Trace(err)
	}

	return env, nil
}