コード例 #1
0
ファイル: test_test.go プロジェクト: moypray/rexray
func getRexRayNoDrivers() (*core.RexRay, error) {
	c := config.New()
	c.OSDrivers = []string{""}
	c.VolumeDrivers = []string{""}
	c.StorageDrivers = []string{""}
	r := core.New(c)
	r.InitDrivers()
	return r, nil
}
コード例 #2
0
ファイル: test_test.go プロジェクト: nutmegdevelopment/rexray
func getRexRayNoDrivers() (*core.RexRay, error) {
	c := config.New()
	c.Set("osDrivers", []string{""})
	c.Set("volumeDrivers", []string{""})
	c.Set("storageDrivers", []string{""})
	r := core.New(c)
	r.InitDrivers()
	return r, nil
}
コード例 #3
0
ファイル: test_test.go プロジェクト: moypray/rexray
func TestNewNoVolumeDrivers(t *testing.T) {
	c := config.New()
	c.OSDrivers = []string{mock.MockOSDriverName}
	c.VolumeDrivers = []string{}
	c.StorageDrivers = []string{mock.MockStorDriverName}
	r := core.New(c)
	if err := r.InitDrivers(); err != errors.ErrNoVolumeDrivers {
		t.Fatal(err)
	}
}
コード例 #4
0
ファイル: test_test.go プロジェクト: nutmegdevelopment/rexray
func TestNewNoVolumeDrivers(t *testing.T) {
	c := config.New()
	c.Set("osDrivers", []string{mock.MockOSDriverName})
	c.Set("volumeDrivers", []string{})
	c.Set("storageDrivers", []string{mock.MockStorDriverName})
	r := core.New(c)
	if err := r.InitDrivers(); err != errors.ErrNoVolumeDrivers {
		t.Fatal(err)
	}
}
コード例 #5
0
ファイル: test_test.go プロジェクト: moypray/rexray
func getRexRay() (*core.RexRay, error) {
	c := config.New()
	c.OSDrivers = []string{mock.MockOSDriverName}
	c.VolumeDrivers = []string{mock.MockVolDriverName}
	c.StorageDrivers = []string{mock.MockStorDriverName}
	r := core.New(c)

	if err := r.InitDrivers(); err != nil {
		return nil, err
	}

	return r, nil
}
コード例 #6
0
ファイル: rexray.go プロジェクト: pb-it/rexray
// New creates a new REX-Ray instance and configures it with the
// provided configuration instance.
func New(conf *config.Config) *RexRay {

	if conf == nil {
		conf = config.New()
	}

	r := &RexRay{
		Config:  conf,
		drivers: map[string]Driver{},
	}

	for name, ctor := range driverCtors {
		r.drivers[name] = ctor()
		log.WithField("driverName", name).Debug("constructed driver")
	}

	return r
}
コード例 #7
0
ファイル: voldriver.go プロジェクト: nutmegdevelopment/rexray
func init() {
	//tcpAddr := fmt.Sprintf("tcp://:%d", ModPort)

	_, fsPath, parseAddrErr := util.ParseAddress(modAddress)
	if parseAddrErr != nil {
		panic(parseAddrErr)
	}

	fsPathDir := filepath.Dir(fsPath)
	os.MkdirAll(fsPathDir, 0755)

	mc := &module.Config{
		Address: modAddress,
		Config:  config.New(),
	}

	module.RegisterModule(modName, true, newMod, []*module.Config{mc})
}