diff --git a/fuel_health/config.py b/fuel_health/config.py index b81b5586..214cda4f 100644 --- a/fuel_health/config.py +++ b/fuel_health/config.py @@ -752,10 +752,18 @@ class NailgunConfig(object): ifaces_resp = self.req_session.get( self.nailgun_url + api_url).json() for iface in ifaces_resp: - if ('sriov' in iface['interface_properties'] and - iface['interface_properties']['sriov']['enabled']): - sriov_physnets.append( - iface['interface_properties']['sriov']['physnet']) + if 'interface_properties' in iface: + if ('sriov' in iface['interface_properties'] and + iface['interface_properties'][ + 'sriov']['enabled']): + sriov_physnets.append( + iface['interface_properties']['sriov']['physnet']) + else: + if ('sriov' in iface['attributes'] and + iface['attributes']['sriov']['enabled']['value']): + sriov_physnets.append( + iface['attributes']['sriov']['physnet']['value']) + self.compute.sriov_physnets = sriov_physnets # Find first compute with enabled DPDK @@ -764,11 +772,22 @@ class NailgunConfig(object): ifaces_resp = self.req_session.get( self.nailgun_url + api_url).json() for iface in ifaces_resp: - if 'dpdk' in iface['interface_properties']: - if 'enabled' in iface['interface_properties']['dpdk']: - if iface['interface_properties']['dpdk']['enabled']: - self.compute.dpdk_compute_fqdn = compute['fqdn'] - break + if 'interface_properties' in iface: + if 'dpdk' in iface['interface_properties']: + if 'enabled' in iface['interface_properties']['dpdk']: + if iface['interface_properties'][ + 'dpdk']['enabled']: + self.compute.dpdk_compute_fqdn = compute[ + 'fqdn'] + break + else: + if 'dpdk' in iface['attributes']: + if 'enabled' in iface['attributes']['dpdk']: + if iface['attributes']['dpdk'][ + 'enabled']['value']: + self.compute.dpdk_compute_fqdn = compute[ + 'fqdn'] + break self.compute.compute_nodes = compute_ips ceph_nodes = filter(lambda node: 'ceph-osd' in node['roles'], diff --git a/fuel_plugin/ostf_adapter/mixins.py b/fuel_plugin/ostf_adapter/mixins.py index 16d0f17a..7da8e504 100644 --- a/fuel_plugin/ostf_adapter/mixins.py +++ b/fuel_plugin/ostf_adapter/mixins.py @@ -168,13 +168,22 @@ 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 ('sriov' in iface['interface_properties'] and - iface['interface_properties']['sriov']['enabled']): - sriov_compute_ids.append(compute_id) - if 'dpdk' in iface['interface_properties']: - if 'enabled' in iface['interface_properties']['dpdk']: - if iface['interface_properties']['dpdk']['enabled']: - dpdk_compute_ids.append(compute_id) + if 'interface_properties' in iface: + if ('sriov' in iface['interface_properties'] and + iface['interface_properties']['sriov']['enabled']): + sriov_compute_ids.append(compute_id) + if 'dpdk' in iface['interface_properties']: + if 'enabled' in iface['interface_properties']['dpdk']: + if iface['interface_properties']['dpdk']['enabled']: + dpdk_compute_ids.append(compute_id) + else: + if ('sriov' in iface['attributes'] and + iface['attributes']['sriov']['enabled']['value']): + sriov_compute_ids.append(compute_id) + if 'dpdk' in iface['attributes']: + if 'enabled' in iface['attributes']['dpdk']: + if iface['attributes']['dpdk']['enabled']['value']: + dpdk_compute_ids.append(compute_id) deployment_tags = set()