Skip to content

Commit

Permalink
VsphereDevicePathResolver -> ScsiDevicePathResolver
Browse files Browse the repository at this point in the history
Signed-off-by: Maria Shaldibina <[email protected]>
  • Loading branch information
st3v committed Dec 19, 2014
1 parent 229aea8 commit e08a894
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import (

const maxScanRetries = 30

type vsphereDevicePathResolver struct {
type scsiDevicePathResolver struct {
diskWaitTimeout time.Duration
fs boshsys.FileSystem
}

func NewVsphereDevicePathResolver(
func NewScsiDevicePathResolver(
diskWaitTimeout time.Duration,
fs boshsys.FileSystem,
) (vsphereDevicePathResolver vsphereDevicePathResolver) {
vsphereDevicePathResolver.fs = fs
vsphereDevicePathResolver.diskWaitTimeout = diskWaitTimeout
) (scsiDevicePathResolver scsiDevicePathResolver) {
scsiDevicePathResolver.fs = fs
scsiDevicePathResolver.diskWaitTimeout = diskWaitTimeout
return
}

func (devicePathResolver vsphereDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (realPath string, timedOut bool, err error) {
func (devicePathResolver scsiDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.DiskSettings) (realPath string, timedOut bool, err error) {
devicePaths, err := devicePathResolver.fs.Glob("/sys/bus/scsi/devices/*:0:0:0/block/*")
if err != nil {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var _ = Describe("VSphere Path Resolver", func() {

BeforeEach(func() {
fs = fakesys.NewFakeFileSystem()
resolver = NewVsphereDevicePathResolver(sleepInterval, fs)
resolver = NewScsiDevicePathResolver(sleepInterval, fs)

fs.SetGlob("/sys/bus/scsi/devices/*:0:0:0/block/*", []string{
"/sys/bus/scsi/devices/0:0:0:0/block/sr0",
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewProvider(logger boshlog.Logger, platform boshplatform.Platform, options
mappedDevicePathResolver := boshdpresolv.NewMappedDevicePathResolver(500*time.Millisecond, fs)
virtioDevicePathResolver := boshdpresolv.NewVirtioDevicePathResolver(idDevicePathResolver, mappedDevicePathResolver, logger)

vsphereDevicePathResolver := boshdpresolv.NewVsphereDevicePathResolver(500*time.Millisecond, fs)
scsiDevicePathResolver := boshdpresolv.NewScsiDevicePathResolver(500*time.Millisecond, fs)
dummyDevicePathResolver := boshdpresolv.NewDummyDevicePathResolver()

resolver := NewRegistryEndpointResolver(
Expand Down Expand Up @@ -69,7 +69,7 @@ func NewProvider(logger boshlog.Logger, platform boshplatform.Platform, options
"openstack": openstackInfrastructure,
"dummy": NewDummyInfrastructure(fs, dirProvider, platform, dummyDevicePathResolver),
"warden": NewWardenInfrastructure(platform, dummyDevicePathResolver, wardenRegistryProvider),
"vsphere": NewVsphereInfrastructure(platform, vsphereDevicePathResolver, logger),
"vsphere": NewVsphereInfrastructure(platform, scsiDevicePathResolver, logger),
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = Describe("Provider", func() {
})

It("returns vsphere infrastructure", func() {
expectedDevicePathResolver := boshdpresolv.NewVsphereDevicePathResolver(
expectedDevicePathResolver := boshdpresolv.NewScsiDevicePathResolver(
500*time.Millisecond,
platform.GetFs(),
)
Expand Down

0 comments on commit e08a894

Please sign in to comment.