Fix Mitaka compatibility
One of the imports works for Newton but not Mitaka, leaving Mitaka to fall back to a bunch of imports that don't work for it. Break conditionals up. Change-Id: If8d2ba23728646786ab29752b4207de9eece4d2d
This commit is contained in:
parent
707612ce72
commit
d420a8bea7
@ -20,26 +20,34 @@
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Mitaka+
|
||||||
import neutron_lib.constants
|
import neutron_lib.constants
|
||||||
import neutron_lib.db.model_base
|
|
||||||
import neutron_lib.exceptions
|
import neutron_lib.exceptions
|
||||||
import neutron_lib.plugins.directory
|
|
||||||
|
|
||||||
n_const = neutron_lib.constants
|
n_const = neutron_lib.constants
|
||||||
n_exec = neutron_lib.exceptions
|
n_exec = neutron_lib.exceptions
|
||||||
model_base = neutron_lib.db.model_base
|
|
||||||
directory = neutron_lib.plugins.directory
|
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import neutron.common.exceptions
|
import neutron.common.exceptions
|
||||||
import neutron.constants
|
import neutron.constants
|
||||||
import neutron.db
|
|
||||||
import neutron.manager
|
|
||||||
|
|
||||||
n_const = neutron.constants
|
n_const = neutron.constants
|
||||||
n_exec = neutron.common.exceptions
|
n_exec = neutron.common.exceptions
|
||||||
model_base = neutron.db.model_base
|
|
||||||
|
try:
|
||||||
|
# Newton+
|
||||||
|
import neutron_lib.db.model_base
|
||||||
|
import neutron_lib.plugins.directory
|
||||||
|
|
||||||
|
model_base = neutron_lib.db.model_base
|
||||||
|
directory = neutron_lib.plugins.directory
|
||||||
|
|
||||||
|
except ImportError:
|
||||||
|
import neutron.db
|
||||||
|
import neutron.manager
|
||||||
|
|
||||||
directory = neutron.manager.NeutronManager
|
directory = neutron.manager.NeutronManager
|
||||||
|
model_base = neutron.db.model_base
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user