fpga_plugin: don't exit if OPAE driver is not loaded

This commit is contained in:
Dmitry Rozhkov 2018-09-05 14:36:12 +03:00
parent 7caf3adcab
commit 5231a9cc1f
2 changed files with 4 additions and 4 deletions

View File

@ -241,7 +241,8 @@ func (dp *devicePlugin) scanFPGAs() (dpapi.DeviceTree, error) {
fpgaFiles, err := ioutil.ReadDir(dp.sysfsDir) fpgaFiles, err := ioutil.ReadDir(dp.sysfsDir)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "Can't read sysfs folder") fmt.Printf("WARNING: Can't read folder %s. Kernel driver not loaded?\n", dp.sysfsDir)
return dp.getDevTree([]device{}), nil
} }
for _, fpgaFile := range fpgaFiles { for _, fpgaFile := range fpgaFiles {

View File

@ -223,9 +223,8 @@ func TestScanFPGAs(t *testing.T) {
mode string mode string
}{ }{
{ {
name: "No sysfs folder given", name: "No sysfs folder exists",
mode: afMode, mode: afMode,
errorContains: "Can't read sysfs folder",
}, },
{ {
name: "FPGA device without FME and ports", name: "FPGA device without FME and ports",