summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Khlyunev <vkhlyunev@mirantis.com>2017-01-10 23:04:22 +0400
committerVladimir Khlyunev <vkhlyunev@mirantis.com>2017-03-31 12:01:43 +0000
commitf1d636e508658bb027da5f981f11b4a788841fa1 (patch)
treecfc9ec1a28027df7cd43481d6a3f4a9a454d9edf
parent92725b64bc173b162dcdf6a7f9173b96c377be48 (diff)
Fix sriov-related methods
- Introduce new method for getting devops node based on nailgun node's id - Add missing 'value' key to enabling sriov Change-Id: I95b60c25eab97e8577a16481741a76db99207976 (cherry picked from commit 8d2ccd2d268c29702b420c477768de62bc7a695f)
Notes
Notes (review): Code-Review+2: Dennis Dmitriev <ddmitriev@mirantis.com> Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+1: Alexey Stepanov <penguinolog@gmail.com> Workflow+1: Alexey Stepanov <penguinolog@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 31 Mar 2017 13:27:57 +0000 Reviewed-on: https://review.openstack.org/452173 Project: openstack/fuel-qa Branch: refs/heads/master
-rw-r--r--fuelweb_test/models/fuel_web_client.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py
index ad8c92a..6e82fe9 100644
--- a/fuelweb_test/models/fuel_web_client.py
+++ b/fuelweb_test/models/fuel_web_client.py
@@ -1217,6 +1217,17 @@ class FuelWebClient29(object):
1217 return self.get_devops_node_by_mac(nailgun_node['mac']) 1217 return self.get_devops_node_by_mac(nailgun_node['mac'])
1218 1218
1219 @logwrap 1219 @logwrap
1220 def get_devops_node_by_nailgun_node_id(self, nailgun_node_id):
1221 """Return devops node by nailgun node id
1222
1223 :type nailgun_node_id: int
1224 :rtype: Node or None
1225 """
1226 nailgun_node = [node for node in self.client.list_nodes() if
1227 node['id'] == nailgun_node_id].pop()
1228 return self.get_devops_node_by_mac(nailgun_node['mac'])
1229
1230 @logwrap
1220 def get_devops_node_by_nailgun_fqdn(self, fqdn): 1231 def get_devops_node_by_nailgun_fqdn(self, fqdn):
1221 """Return devops node with nailgun fqdn 1232 """Return devops node with nailgun fqdn
1222 1233
@@ -3159,8 +3170,7 @@ class FuelWebClient29(object):
3159 def check_sriov(self, nailgun_node_id): 3170 def check_sriov(self, nailgun_node_id):
3160 nailgun_node_ifaces = self.client.get_node_interfaces( 3171 nailgun_node_ifaces = self.client.get_node_interfaces(
3161 nailgun_node_id) 3172 nailgun_node_id)
3162 devops_node = self.get_devops_node_by_nailgun_node( 3173 devops_node = self.get_devops_node_by_nailgun_node_id(nailgun_node_id)
3163 nailgun_node_id)
3164 devops_sriov_macs = [i.mac_address for i in devops_node.interfaces 3174 devops_sriov_macs = [i.mac_address for i in devops_node.interfaces
3165 if 'sriov' in i.features] 3175 if 'sriov' in i.features]
3166 nailgun_sriov_nics = [] 3176 nailgun_sriov_nics = []
@@ -3194,7 +3204,7 @@ class FuelWebClient29(object):
3194 'sriov']['sriov_totalvfs'] 3204 'sriov']['sriov_totalvfs']
3195 else: 3205 else:
3196 interface['attributes']['sriov']['enabled']['value'] = True 3206 interface['attributes']['sriov']['enabled']['value'] = True
3197 interface['attributes']['sriov']['numvfs'] = \ 3207 interface['attributes']['sriov']['numvfs']['value'] = \
3198 interface['meta']['sriov']['totalvfs'] 3208 interface['meta']['sriov']['totalvfs']
3199 3209
3200 self.client.put_node_interfaces( 3210 self.client.put_node_interfaces(