Fix compatibility with Manilaclient and Horizon

Horizon has removed Saharaclient and Troveclient from its dependencies,
so, remove their code from Manila-UI too.
Latest release of Manilaclient v1.6.0 broke possibility to import
deprecated v1 API modules having b_u_g 1535692. So, change usage of
manilaclient in the way when we do not hit that bug.

Change-Id: I907502a6dcb9ff8521935428bbb34b930b134553
Closes-Bug: #1535657
This commit is contained in:
vponomaryov 2016-01-19 13:44:11 +02:00
parent 1a8570e550
commit 4b107960a9
2 changed files with 15 additions and 11 deletions

View File

@ -13,11 +13,21 @@
# under the License.
import collections
from manilaclient.v1 import quotas
from manilaclient.v1 import security_services
from manilaclient.v1 import share_networks
from manilaclient.v1 import share_snapshots
from manilaclient.v1 import shares
try:
# NOTE(vponomaryov): Try import latest modules, assuming we have
# manilaclient that is new enough and have v2 API support.
from manilaclient.v2 import quotas
from manilaclient.v2 import security_services
from manilaclient.v2 import share_networks
from manilaclient.v2 import share_snapshots
from manilaclient.v2 import shares
except ImportError:
# NOTE(vponomaryov): If we got here then we have old manilaclient.
from manilaclient.v1 import quotas
from manilaclient.v1 import security_services
from manilaclient.v1 import share_networks
from manilaclient.v1 import share_snapshots
from manilaclient.v1 import shares
from openstack_dashboard import api
from openstack_dashboard.usage import quotas as usage_quotas

View File

@ -24,9 +24,7 @@ from manilaclient import exceptions as manilaclient
from neutronclient.common import exceptions as neutronclient
from novaclient import exceptions as novaclient
from requests import exceptions as requests
from saharaclient.api import base as saharaclient
from swiftclient import client as swiftclient
from troveclient import exceptions as troveclient
UNAUTHORIZED = (
@ -37,7 +35,6 @@ UNAUTHORIZED = (
manilaclient.Unauthorized,
neutronclient.Unauthorized,
heatclient.HTTPUnauthorized,
troveclient.Unauthorized,
)
@ -49,7 +46,6 @@ NOT_FOUND = (
manilaclient.NotFound,
neutronclient.NotFound,
heatclient.HTTPNotFound,
troveclient.NotFound,
)
@ -71,7 +67,5 @@ RECOVERABLE = (
swiftclient.ClientException,
heatclient.HTTPForbidden,
heatclient.HTTPException,
troveclient.ClientException,
saharaclient.APIException,
requests.RequestException,
)