Cast nova server object to dict after refetch

When we assign a floating ip to a server, we re-fetch it from the cloud
so that the metadata is all correct. However, we weren't doing
obj_to_dict on it like all of the other code paths that return out of
create_server - which means that it bombs out on
get_hostvars_from_server if subsequently passed to it.

Change-Id: I3f69f525b7d57ec91f70b77cdbd62aed9816f17d
This commit is contained in:
Monty Taylor 2015-06-02 18:03:29 -05:00
parent 7e69d826c4
commit 8d9cab2eb9
1 changed files with 2 additions and 1 deletions

View File

@ -1746,7 +1746,8 @@ class OpenStackCloud(object):
# floating IP, then it needs to be obtained from
# a recent server object if the above code path exec'd
try:
server = self.manager.submitTask(_tasks.ServerGet(server=server))
server = meta.obj_to_dict(
self.manager.submitTask(_tasks.ServerGet(server=server)))
except Exception as e:
self.log.debug("nova info failed", exc_info=True)
raise OpenStackCloudException(