Add check for sriov keys

That fix is intented to fix swarm tests.
Further investigation required to find out why
there were no sriov keys

Change-Id: Iaa3cbe7a6a0717e8e027d43795fda8c93394ec09
Closes-bug: #1575566
This commit is contained in:
Alexandr Kostrikov 2016-04-27 14:08:24 +03:00
parent 93f6e0db56
commit a3ae1e4c16
2 changed files with 4 additions and 2 deletions

View File

@ -737,7 +737,8 @@ class NailgunConfig(object):
ifaces_resp = self.req_session.get(
self.nailgun_url + api_url).json()
for iface in ifaces_resp:
if iface['interface_properties']['sriov']['enabled']:
if ('sriov' in iface['interface_properties'] and
iface['interface_properties']['sriov']['enabled']):
sriov_physnets.append(
iface['interface_properties']['sriov']['physnet'])
self.compute.sriov_physnets = sriov_physnets

View File

@ -169,7 +169,8 @@ def _get_cluster_attrs(cluster_id, token=None):
'api/nodes/{id}/interfaces'.format(id=compute_id))
ifaces_resp = REQ_SES.get(ifaces_url).json()
for iface in ifaces_resp:
if iface['interface_properties']['sriov']['enabled']:
if ('sriov' in iface['interface_properties'] and
iface['interface_properties']['sriov']['enabled']):
sriov_compute_ids.append(compute_id)
deployment_tags = set()