Collate multiple commits to fix the gate

The gate fails because the clients/libraries the code
depends on were upgraded. Fix by merging the following
two commits.

commit 90e55779e9baa1e7cbdc6e0c737f32bb73721524
Author: Oleksii Chuprykov <ochuprykov@mirantis.com>
Date:   Mon Jul 18 15:29:18 2016 +0300

    Add direct_use=False flag to constructor of novaclient

    As we directly use novaclient class with particular version,
    we need to path direct_use=False to avoid fails.

    Change-Id: Ieb3dcd2b48a172a4e7ad55e44dcdf6329c8bcb0c
    Closes-Bug: #1603976

commit 0156e98e66c9a26649897f0e0b7cd0907cbebff5
Author: Dmitriy Uvarenkov <duvarenkov@mirantis.com>
Date:   Fri Apr 15 13:09:15 2016 +0300

    Fix stack deleting problem in magnum stacks

    In magnumclient/exceptions.py exceptions are imported
    from magnumclient.common.apiclient so exception class
    is not the same as expected in heat/engine/clients/os/magnum.py

    Closes-Bug: #1570781
    Change-Id: Ie60a735470b9adc38675b613950e6480e28136ab

Closes-Bug: #1605617
Change-Id: Ie4519584a0be6e399a08ca281e8e0f4049c52720
This commit is contained in:
Sirushti Murugesan 2016-07-22 18:08:49 +05:30
parent 81ba9a6e68
commit 656ac73c6c
3 changed files with 13 additions and 4 deletions

View File

@ -11,13 +11,18 @@
# License for the specific language governing permissions and limitations
# under the License.
from magnumclient.openstack.common.apiclient import exceptions as mc_exc
from magnumclient.v1 import client as magnum_client
from heat.common import exception
from heat.engine.clients import client_plugin
from heat.engine import constraints
try:
from magnumclient.common.apiclient import exceptions as mc_exc
except ImportError:
# NOTE (duvarenkov): For magnumclient versions before 2.0.0.
from magnumclient.openstack.common.apiclient import exceptions as mc_exc
CLIENT_NAME = 'magnum'

View File

@ -16,8 +16,6 @@ import mock
from oslo_config import cfg
import six
from magnumclient.openstack.common.apiclient import exceptions as mc_exc
from heat.common import exception
from heat.common import template_format
from heat.engine.clients.os import magnum as mc
@ -28,6 +26,12 @@ from heat.engine import template
from heat.tests import common
from heat.tests import utils
try:
from magnumclient.common.apiclient import exceptions as mc_exc
except ImportError:
# NOTE (duvarenkov): For magnumclient versions before 2.0.0.
from magnumclient.openstack.common.apiclient import exceptions as mc_exc
magnum_template = '''
heat_template_version: 2015-04-30

View File

@ -41,7 +41,7 @@ class FakeClient(fakes.FakeClient, Client):
def __init__(self, *args, **kwargs):
super(FakeClient, self).__init__('username', 'password', 'project_id',
'auth_url')
'auth_url', direct_use=False)
self.client = FakeHTTPClient(**kwargs)