Skip to content

Commit 62c0728

Browse files
committed
openstack-nova: 2014.2-12.eayunstack.dev
0044-get-instance-object-from-compute-api.patch Signed-off-by: blkart <[email protected]>
1 parent c57d5c4 commit 62c0728

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 50d80038cd6cf30245293d05271b0218f2d5e614 Mon Sep 17 00:00:00 2001
2+
From: blkart <[email protected]>
3+
Date: Wed, 6 Sep 2017 19:15:39 +0800
4+
Subject: [PATCH] get instance object from compute api
5+
6+
Fix instance has no attribute 'info_cache' issue when
7+
associate/disassociate floating ip.
8+
9+
Fix redmine #10873
10+
11+
Signed-off-by: blkart <[email protected]>
12+
---
13+
nova/api/openstack/compute/contrib/floating_ips.py | 5 +++--
14+
1 file changed, 3 insertions(+), 2 deletions(-)
15+
16+
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py
17+
index 19a31ae..a23ada1 100644
18+
--- a/nova/api/openstack/compute/contrib/floating_ips.py
19+
+++ b/nova/api/openstack/compute/contrib/floating_ips.py
20+
@@ -86,7 +86,7 @@ def get_instance_by_floating_ip_addr(self, context, address):
21+
snagiibfa = self.network_api.get_instance_id_by_floating_address
22+
instance_id = snagiibfa(context, address)
23+
if instance_id:
24+
- return self.compute_api.get(context, instance_id)
25+
+ return self.compute_api.get(context, instance_id, want_objects=True)
26+
27+
28+
def disassociate_floating_ip(self, context, instance, address):
29+
@@ -206,7 +206,8 @@ class FloatingIPActionController(wsgi.Controller):
30+
msg = _("Address not specified")
31+
raise webob.exc.HTTPBadRequest(explanation=msg)
32+
33+
- instance = common.get_instance(self.compute_api, context, id)
34+
+ instance = common.get_instance(self.compute_api, context, id,
35+
+ want_objects=True)
36+
cached_nwinfo = compute_utils.get_nw_info_for_instance(instance)
37+
if not cached_nwinfo:
38+
msg = _('No nw_info cache associated with instance')
39+
--
40+
2.1.0
41+

packaging/openstack-nova/openstack-nova.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Name: openstack-nova
1010
Version: 2014.2
11-
Release: 11%{?dist_eayunstack}
11+
Release: 12%{?dist_eayunstack}
1212
Summary: OpenStack Compute (nova)
1313

1414
Group: Applications/System
@@ -88,6 +88,7 @@ Patch0040: 0040-Libvirt-register-config-opt-es_paas_network.patch
8888
Patch0041: 0041-Handle-exception-when-doing-detach_interface.patch
8989
Patch0042: 0042-Log-exception-from-deallocate_port_for_instance-for-.patch
9090
Patch0043: 0043-Refresh-instance-info-cache-within-lock.patch
91+
Patch0044: 0044-get-instance-object-from-compute-api.patch
9192

9293

9394
BuildArch: noarch
@@ -534,6 +535,7 @@ This package contains documentation files for nova.
534535
%patch0041 -p1
535536
%patch0042 -p1
536537
%patch0043 -p1
538+
%patch0044 -p1
537539

538540
find . \( -name .gitignore -o -name .placeholder \) -delete
539541

@@ -891,6 +893,9 @@ exit 0
891893
%endif
892894

893895
%changelog
896+
* Thu Sep 7 2017 blkart <[email protected]> - 2014.2-12.eayunstack.dev
897+
- 0044-get-instance-object-from-compute-api.patch
898+
894899
* Fri Aug 25 2017 blkart <[email protected]> - 2014.2-11.eayunstack.dev
895900
- 0041-Handle-exception-when-doing-detach_interface.patch
896901
- 0042-Log-exception-from-deallocate_port_for_instance-for-.patch

0 commit comments

Comments
 (0)