Fixing compatibility with RHEL OSP 6
Using conditional imports where required. Change-Id: If3988443906cd2dd20eac4dde297735a1bf2d1e4 Closes-bug: 1506246
This commit is contained in:
@@ -14,13 +14,18 @@
|
|||||||
import logging
|
import logging
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from neutronclient.i18n import _
|
|
||||||
from neutronclient.neutron import v2_0 as neutronV20
|
from neutronclient.neutron import v2_0 as neutronV20
|
||||||
from oslo.serialization import jsonutils
|
from oslo.serialization import jsonutils
|
||||||
|
|
||||||
from gbpclient.common import utils
|
from gbpclient.common import utils
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from neutronclient.i18n import _
|
||||||
|
except ImportError:
|
||||||
|
from neutronclient.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
def _format_network_service_params(net_svc_policy):
|
def _format_network_service_params(net_svc_policy):
|
||||||
try:
|
try:
|
||||||
return '\n'.join([jsonutils.dumps(param) for param in
|
return '\n'.join([jsonutils.dumps(param) for param in
|
||||||
|
|||||||
@@ -22,10 +22,15 @@ import string
|
|||||||
from heatclient.common import template_utils
|
from heatclient.common import template_utils
|
||||||
|
|
||||||
from neutronclient.common import exceptions as exc
|
from neutronclient.common import exceptions as exc
|
||||||
from neutronclient.i18n import _
|
|
||||||
from neutronclient.neutron import v2_0 as neutronV20
|
from neutronclient.neutron import v2_0 as neutronV20
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from neutronclient.i18n import _
|
||||||
|
except ImportError:
|
||||||
|
from neutronclient.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
class ListServiceChainInstance(neutronV20.ListCommand):
|
class ListServiceChainInstance(neutronV20.ListCommand):
|
||||||
"""List service chain instances that belong to a given tenant."""
|
"""List service chain instances that belong to a given tenant."""
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ from keystoneclient.auth.identity import v3 as v3_auth
|
|||||||
from keystoneclient import discover
|
from keystoneclient import discover
|
||||||
from keystoneclient.openstack.common.apiclient import exceptions as ks_exc
|
from keystoneclient.openstack.common.apiclient import exceptions as ks_exc
|
||||||
from keystoneclient import session
|
from keystoneclient import session
|
||||||
from oslo.utils import encodeutils
|
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from cliff import app
|
from cliff import app
|
||||||
@@ -35,12 +34,24 @@ from cliff import commandmanager
|
|||||||
from neutronclient.common import clientmanager
|
from neutronclient.common import clientmanager
|
||||||
from neutronclient.common import exceptions as exc
|
from neutronclient.common import exceptions as exc
|
||||||
from neutronclient.common import utils
|
from neutronclient.common import utils
|
||||||
from neutronclient.i18n import _
|
|
||||||
from neutronclient.version import __version__
|
from neutronclient.version import __version__
|
||||||
|
|
||||||
from gbpclient.gbp.v2_0 import groupbasedpolicy as gbp
|
from gbpclient.gbp.v2_0 import groupbasedpolicy as gbp
|
||||||
from gbpclient.gbp.v2_0 import servicechain
|
from gbpclient.gbp.v2_0 import servicechain
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from oslo.utils import encodeutils
|
||||||
|
except ImportError:
|
||||||
|
from neutronclient.openstack.common import strutils as encodeutils
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from neutronclient.i18n import _
|
||||||
|
except ImportError:
|
||||||
|
from neutronclient.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
VERSION = '2.0'
|
VERSION = '2.0'
|
||||||
NEUTRON_API_VERSION = '2.0'
|
NEUTRON_API_VERSION = '2.0'
|
||||||
clientmanager.neutron_client.API_VERSIONS = {
|
clientmanager.neutron_client.API_VERSIONS = {
|
||||||
|
|||||||
@@ -20,11 +20,16 @@ from neutronclient.common import constants
|
|||||||
from neutronclient.common import exceptions
|
from neutronclient.common import exceptions
|
||||||
from neutronclient.common import serializer
|
from neutronclient.common import serializer
|
||||||
from neutronclient.common import utils
|
from neutronclient.common import utils
|
||||||
from neutronclient.i18n import _
|
|
||||||
import requests
|
import requests
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from neutronclient.i18n import _
|
||||||
|
except ImportError:
|
||||||
|
from neutronclient.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user