
from monascaclient.openstack.common.apiclient import exceptions as monascacli
from openstack_dashboard.test.test_data import exceptions


def data(TEST):
    TEST.exceptions = exceptions.data

    monitoring_exception = monascacli.ClientException
    TEST.exceptions.monitoring = exceptions.create_stubbed_exception(
        monitoring_exception)

try:
    from monascaclient.apiclient import exceptions as monascacli
except ImportError:
    from monascaclient.openstack.common.apiclient import exceptions as monascacli

from openstack_dashboard.test.test_data import exceptions


def data(TEST):
    TEST.exceptions = exceptions.data

    monitoring_exception = monascacli.ClientException
    TEST.exceptions.monitoring = exceptions.create_stubbed_exception(
        monitoring_exception)

Adjust tests for python-monascaclient >= 1.3.0
Adjust tests for python-monascaclient >= 1.3.0

the exceptions module was moved out of the openstack.common namespace,
so try to import the new location first and fall back to the old
one if it doesn't exist.

Change-Id: I3305775baaab15dca8d5e7e5cfc0932f94d4d153

+ try:
+     from monascaclient.apiclient import exceptions as monascacli
+ except ImportError:
+     from monascaclient.openstack.common.apiclient import exceptions as monascacli
  
- from monascaclient.openstack.common.apiclient import exceptions as monascacli
  from openstack_dashboard.test.test_data import exceptions
  
  
  def data(TEST):
      TEST.exceptions = exceptions.data
  
      monitoring_exception = monascacli.ClientException
      TEST.exceptions.monitoring = exceptions.create_stubbed_exception(
          monitoring_exception)
  
Adjust tests for python-monascaclient >= 1.3.0
## Code Before:

from monascaclient.openstack.common.apiclient import exceptions as monascacli
from openstack_dashboard.test.test_data import exceptions


def data(TEST):
    TEST.exceptions = exceptions.data

    monitoring_exception = monascacli.ClientException
    TEST.exceptions.monitoring = exceptions.create_stubbed_exception(
        monitoring_exception)

## Instruction:
Adjust tests for python-monascaclient >= 1.3.0
## Code After:
try:
    from monascaclient.apiclient import exceptions as monascacli
except ImportError:
    from monascaclient.openstack.common.apiclient import exceptions as monascacli

from openstack_dashboard.test.test_data import exceptions


def data(TEST):
    TEST.exceptions = exceptions.data

    monitoring_exception = monascacli.ClientException
    TEST.exceptions.monitoring = exceptions.create_stubbed_exception(
        monitoring_exception)
