Comment 2 for bug 2159619

Revision history for this message
Udayendu Kar (uskar88) wrote :

This is interesting. Its just not the limit.py in identity but in the keytone backend as well.

I am able to reproduce this issue:

(kolla-venv) root@uskar-dev-node:~# diff -u /root/kolla-venv/lib/python3.11/site-packages/openstackclient/identity/v3/limit.py /root/kolla-venv/lib/python3.11/site-packages/openstackclient/identity/v3/limit.py.orig
--- /root/kolla-venv/lib/python3.11/site-packages/openstackclient/identity/v3/limit.py 2026-07-28 21:35:14.042927672 -0700
+++ /root/kolla-venv/lib/python3.11/site-packages/openstackclient/identity/v3/limit.py.orig 2026-07-28 20:34:59.378907800 -0700
@@ -244,7 +244,7 @@
         kwargs = {}
         if parsed_args.description:
             kwargs["description"] = parsed_args.description
- if parsed_args.resource_limit is not None:
+ if parsed_args.resource_limit:
             kwargs["resource_limit"] = parsed_args.resource_limit
         limit = identity_client.update_limit(parsed_args.limit_id, **kwargs)

(kolla-venv) root@uskar-dev-node:~# docker exec -it keystone bash
(keystone)[root@uskar-dev-node /]# cp /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py.orig
(keystone)[root@uskar-dev-node /]# vim /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py
(keystone)[root@uskar-dev-node /]# diff -u /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py.orig
--- /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py 2026-07-28 21:28:15.194783229 -0700
+++ /var/lib/kolla/venv/lib/python3.11/site-packages/keystone/limit/backends/sql.py.orig 2026-07-28 21:27:00.182045808 -0700
@@ -283,7 +283,7 @@
     def update_limit(self, limit_id, limit):
         with sql.session_for_write() as session:
             ref = self._get_limit(session, limit_id)
- if limit.get('resource_limit') is not None:
+ if limit.get('resource_limit'):
                 ref.resource_limit = limit['resource_limit']
             if limit.get('description'):
                 ref.description = limit['description']
(keystone)[root@uskar-dev-node /]#
exit

(kolla-venv) root@uskar-dev-node:~# docker restart keystone
(kolla-venv) root@uskar-dev-node:~# openstack limit set --resource-limit 0 2f92e83b008d4adfb28b949bae7306a8
+----------------+----------------------------------+
| Field | Value |
+----------------+----------------------------------+
| description | None |
| id | 2f92e83b008d4adfb28b949bae7306a8 |
| project_id | 6455f7fd62634287832009f70e52a07e |
| region_id | None |
| resource_limit | 0 |
| resource_name | cores |
| service_id | 0fa9044d90e24ab584eb8f9b2b447c21 |
+----------------+----------------------------------+

(kolla-venv) root@uskar-dev-node:~# openstack limit show 2f92e83b008d4adfb28b949bae7306a8
+----------------+----------------------------------+
| Field | Value |
+----------------+----------------------------------+
| description | None |
| id | 2f92e83b008d4adfb28b949bae7306a8 |
| project_id | 6455f7fd62634287832009f70e52a07e |
| region_id | None |
| resource_limit | 0 |
| resource_name | cores |
| service_id | 0fa9044d90e24ab584eb8f9b2b447c21 |
+----------------+----------------------------------+
(kolla-venv) root@uskar-dev-node:~#

So, just patching limit.py won't help. We have to fix the sql.py too. Could you please test the above once. Meanwhile I will prepare the commit.