Revision history [back]

How to specify binding:profile with python neutronclient library

Part of python script

  body = {
            "port": {
                'name': name,
                'network_id': chain_network.get_uuid(),
                'binding:vnic_type': vnic_type,
                'binding:profile': 'capabilities[switchdev]'
            }

Output log: BadRequest: Invalid input for binding:profile. Reason: 'capabilities[switchdev]' is not a dictionary.

I can run the same with openstack CLI using this command:

openstack port create --network provider-net --vnic-type direct --binding-profile '{"capabilities": ["switchdev"]}' direct-port