[Bug 2130459] Please test proposed package

Edward Hope-Morley 2130459 at bugs.launchpad.net
Fri Feb 20 11:51:34 UTC 2026


Hello Zhan, or anyone else affected,

Accepted python-neutronclient into caracal-proposed. The package will
build now and be available in the Ubuntu Cloud Archive in a few hours,
and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed
repository:

  sudo add-apt-repository cloud-archive:caracal-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, and change the tag
from verification-caracal-needed to verification-caracal-done. If it
does not fix the bug for you, please add a comment stating that, and
change the tag to verification-caracal-failed. In either case, details
of your testing will help us make a better decision.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance!

** Changed in: cloud-archive/caracal
       Status: In Progress => Fix Committed

** Tags added: verification-caracal-needed

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to Ubuntu Cloud Archive.
https://bugs.launchpad.net/bugs/2130459

Title:
  neutronclient uses the wrong key when listing port bindings

Status in Ubuntu Cloud Archive:
  Fix Committed
Status in Ubuntu Cloud Archive antelope series:
  Won't Fix
Status in Ubuntu Cloud Archive bobcat series:
  Won't Fix
Status in Ubuntu Cloud Archive caracal series:
  Fix Committed
Status in Ubuntu Cloud Archive dalmatian series:
  Fix Committed
Status in Ubuntu Cloud Archive epoxy series:
  Fix Committed
Status in Ubuntu Cloud Archive flamingo series:
  Fix Committed
Status in Ubuntu Cloud Archive gazpacho series:
  Fix Released
Status in Ubuntu Cloud Archive ussuri series:
  Won't Fix
Status in Ubuntu Cloud Archive yoga series:
  In Progress
Status in Ubuntu Cloud Archive zed series:
  Won't Fix
Status in python-neutronclient:
  Fix Released
Status in python-neutronclient package in Ubuntu:
  Fix Released
Status in python-neutronclient source package in Bionic:
  Won't Fix
Status in python-neutronclient source package in Focal:
  Won't Fix
Status in python-neutronclient source package in Jammy:
  Fix Committed
Status in python-neutronclient source package in Noble:
  Fix Committed
Status in python-neutronclient source package in Plucky:
  Won't Fix
Status in python-neutronclient source package in Questing:
  Fix Committed
Status in python-neutronclient source package in Resolute:
  Fix Released

Bug description:
  [ Impact ]

  A bug in python-neutronclient causes a KeyError when attempting to list
  port bindings via the client. Specifically, calling the list_port_bindings
  method triggers a KeyError: 'port_bindings'. This occurs because the client
  expects the Neutron API response to contain the "port_bindings" key.

  This affects any service or tool that calls this method, and as such can
  cause functional failures in Openstack deployments. Upstream has fixed this
  by adjusting the parsing of the API response to use the correct key "bindings"
  instead of "port_bindings". The attached debdiffs apply this same fix to 
  affected Ubuntu and Ubuntu Cloud Archive series.

  [ Test Plan ]

  Deploy an OpenStack environment on the target series.

  1. Ensure you have administrative access to the deployed cloud and source
  credentials.

  2. Create a test network and a port to run the query against.

  ```sh
  openstack network create test-net

  openstack subnet create --network test-net --subnet-range
  10.10.99.0/24 test-subnet

  PORT_ID=$(openstack port create --network test-net test-port -c id -f value)
  ```

  3. Verify the failure exists using the following python script. It attempts
  to call the problematic API method.

  Create a file named reproduce.py with the following contents:

  ```py
  import os
  import sys
  from keystoneauth1 import identity, session
  from neutronclient.v2_0 import client

  # Authenticate using environment variables
  auth = identity.v3.Password(
      auth_url=os.environ['OS_AUTH_URL'],
      username=os.environ['OS_USERNAME'],
      password=os.environ['OS_PASSWORD'],
      project_name=os.environ['OS_PROJECT_NAME'],
      user_domain_name=os.environ.get('OS_USER_DOMAIN_NAME', 'Default'),
      project_domain_name=os.environ.get('OS_PROJECT_DOMAIN_NAME', 'Default')
  )
  sess = session.Session(auth=auth)
  neutron = client.Client(session=sess)

  # Get the port ID
  port_id = sys.argv[1]

  print(f"Attempting list_port_bindings for {port_id}...")
  try:
      bindings = neutron.list_port_bindings(port_id)
      print("SUCCESS: Bindings retrieved:", bindings)
  except Exception as e:
      print(f"FAILURE: error: {e}")
      sys.exit(1)
  ```

  Run this script with the newly created port:

  ```sh
  python3 reproduce.py $PORT_ID
  ```

  The expected result before applying the fix is that the script will 
  fail with FAILURE: error: KeyError: 'port_bindings'.

  The expected result after applying the fix is that the script will 
  run successfully.

  [ Where problems could occur ]

  API response mismatch: The patch changes the key lookup from "port_bindings"
  to "bindings". If there are non-standard Neutron API implementations that
  only "port_bindings" and not the expected structure, this fix could theoretically
  prevent usage of this method that was previously working.

  [ Other Info ]

  This backports the merged upstream fix which corrects the JSON key.
  The description / message from the original commit message is provided
  below:

  v2_0: Use 'bindings' when listing port bindings
  This commit fixes a bug in v2_0 client's "list_port_bindings"
  function, where it uses "port_bindings" to access Neutron's
  response, instead of "bindings" [0].

  [0]: https://docs.openstack.org/api-ref/network/v2/index.html#show-
  port-binding-of-a-port

  Closes-Bug: #2130459
  Change-Id: I32ef753ec212b55f698e3844e043f68b22992ead
  Signed-off-by: Zhan Zhang <zzhang953 at bloomberg.net>

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/2130459/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list