Exclude applying of hostname for same node a twice

Sometimes method "self.fuel_web.client.list_nodes()" returns lists
of nodes which were sorted by differently, and as consequence of that,
sometimes self.fuel_web.client.list_nodes()[0] equals
self.fuel_web.client.list_nodes()[1].

Change-Id: I0e1e32c11bb759b882ef2c548f50e4d81aa85b46
Closes-Bug: #1613846
(cherry picked from commit f77235fed4)
This commit is contained in:
Alisa Tselovalnikova 2016-09-12 16:30:30 +03:00
parent 4f10639e7c
commit 4ae0a608ed
1 changed files with 3 additions and 2 deletions

View File

@ -230,11 +230,12 @@ class CustomHostname(TestBasic):
# Set a custom hostname for a node for the 1st time
custom_hostname = 'custom-hostname'
node = self.fuel_web.client.list_nodes()[0]
node_list = self.fuel_web.client.list_nodes()
node = node_list[0]
self.fuel_web.client.set_hostname(node['id'], custom_hostname)
# Try to set duplicate hostname for another node
node = self.fuel_web.client.list_nodes()[1]
node = node_list[1]
assert_raises(
http_exceptions.Conflict,
self.fuel_web.client.set_hostname,