Prevent driver load failures from objects

There's been an intermittent issue where getting a list of all
drivers would fail to get all defined classes. With recent local
tests, once it got 103 drivers, but several times it got 69
drivers.

This appears to be from exceptions thrown while loading the
decorated classes with various cinder.objects classes not being
defined. To get around this, this adds an explicit load of all
cinder.objects before attempting to get the driver classes.

Change-Id: Ief4a93ec2d8256424166c7bf3b9d48a79a6e5e54
This commit is contained in:
Sean McGinnis 2017-01-16 17:17:48 -06:00
parent e90d1b01f6
commit d1166474ab
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,11 @@ import argparse
import os
from cinder.interface import util
from cinder import objects
# Object loading can cause issues loading drivers, force it up front
objects.register_all()
parser = argparse.ArgumentParser(prog="generate_driver_list")