Esempio n. 1
0
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
}
Esempio n. 2
0
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
}
Esempio n. 3
0
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)
	}
}
Esempio n. 4
0
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)
	}
}
Esempio n. 5
0
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
}
Esempio n. 6
0
// 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
}
Esempio n. 7
0
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})
}