Merge "Allow to provide mdev addresses as list"

This commit is contained in:
Zuul 2021-11-16 17:51:29 +00:00 committed by Gerrit Code Review
commit e9f3c79832
2 changed files with 5 additions and 3 deletions

View File

@ -529,9 +529,11 @@ nova_api_os_compute_uwsgi_ini_overrides: {}
# Example 2:
# nova_enabled_mdev_types:
# - type: nvidia-35
# address: <device address>
# address: "<device address.0>,<device address.1>"
# - type: nvidia-36
# address: <another device address>
# address:
# - "<another device address.0>"
# - "<another device address.1>"
nova_enabled_mdev_types: "{{ nova_enabled_vgpu_types | default({}) }}"
# PCI devices passthrough to nova

View File

@ -307,7 +307,7 @@ enabled_mdev_types = {{ nova_enabled_mdev_types | map(attribute='type') | list |
{% for record in nova_enabled_mdev_types | selectattr('address', 'defined') | list %}
[mdev_{{ record.type }}]
device_addresses = {{ record.address }}
device_addresses = {{ (record.address is string) | ternary(record.address, record.address | join(',')) }}
{% endfor %}
{% endif %}