~hopem/nova/precise-updates-sru-lp1119248

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/compute/contrib/test_cloudpipe.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2012-08-27 14:50:40 UTC
  • mfrom: (79.1.3 precise-proposed)
  • Revision ID: package-import@ubuntu.com-20120827145040-vlkdab5i0smvnhei
Tags: 2012.1.3+stable-20120827-4d2a4afe-0ubuntu1
* New upstream snapshot, fixes FTBFS in -proposed. (LP: #1041120)
* Resynchronize with stable/essex (4d2a4afe):
  - [5d63601] Inappropriate exception handling on kvm live/block migration
    (LP: #917615)
  - [ae280ca] Deleted floating ips can cause instance delete to fail
    (LP: #1038266)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from lxml import etree
19
19
 
20
 
from nova.api.openstack import common
21
20
from nova.api.openstack import wsgi
22
21
from nova.api.openstack.compute.contrib import cloudpipe
 
22
from nova.compute import utils as compute_utils
23
23
from nova import db
24
24
from nova import flags
25
25
from nova import test
67
67
 
68
68
    def test_cloudpipe_list_no_network(self):
69
69
 
70
 
        def common_get_nw_info_for_instance(context, instance):
 
70
        def fake_get_nw_info_for_instance(instance):
71
71
            return {}
72
72
 
73
 
        self.stubs.Set(common, "get_nw_info_for_instance",
74
 
                       common_get_nw_info_for_instance)
 
73
        self.stubs.Set(compute_utils, "get_nw_info_for_instance",
 
74
                       fake_get_nw_info_for_instance)
75
75
        self.stubs.Set(self.controller.compute_api, "get_all",
76
76
                       compute_api_get_all)
77
77
        req = fakes.HTTPRequest.blank('/v2/fake/os-cloudpipe')
88
88
            return {'vpn_public_address': '127.0.0.1',
89
89
                    'vpn_public_port': 22}
90
90
 
91
 
        def common_get_nw_info_for_instance(context, instance):
 
91
        def fake_get_nw_info_for_instance(instance):
92
92
            return fake_network.fake_get_instance_nw_info(self.stubs,
93
93
                                                          spectacular=True)
94
94
 
95
 
        self.stubs.Set(common, "get_nw_info_for_instance",
96
 
                       common_get_nw_info_for_instance)
 
95
        self.stubs.Set(compute_utils, "get_nw_info_for_instance",
 
96
                       fake_get_nw_info_for_instance)
97
97
        self.stubs.Set(self.controller.network_api, "get",
98
98
                       network_api_get)
99
99
        self.stubs.Set(self.controller.compute_api, "get_all",