KeyError when assigning quotas

Đang mở
#58 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ansible, python
Lĩnh vực
cloud, infrastructure

Hướng nghiên cứu

Bắt đầu với module quota tại ansible_collections/openstack/cloud/plugins/modules/quota.py, khoảng dòng 536, sau đó kiểm tra lời gọi openstack block_storage v3 update_quota_set được hiển thị trong traceback. Tái hiện task Ensure quotas are set với các quota đã thay đổi. Được xem là hoàn tất khi việc gán quota hoàn thành mà không gặp lỗi KeyError: 'project_id'.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

When attempting to assign quotas to a project if the quotas changes it will cause a KeyError: 'project_id'.

TASK [stackhpc.openstack.os_projects : Ensure quotas are set] ****************************************************************************************************************************************************************************************************************************************
Friday 22 August 2025  12:49:34 +0000 (0:00:01.327)       0:00:22.558 *********
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'project_id'
failed: [localhost] (item=demo) => changed=false
  ansible_loop_var: item
  item:
    description: OpenStack demo project
    keypairs:
    - name: id_ed25519
      public_key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICKx4TMa8vtpOe3qHeMX4Z7JZyucBcqlfv8iFY6dZkzB
    name: demo
    project_domain: default
    quotas:
      backup_gigabytes: -1
      backups: -1
      cores: -1
      floatingip: -1
      gigabytes: -1
      injected_file_size: -1
      injected_files: -1
      instances: -1
      key_pairs: -1
      per_volume_gigabytes: -1
      ram: -1
      security_group: -1
      security_group_rule: -1
      snapshots: -1
      volumes: -1
    user_domain: default
    users:
    - description: StackHPC Demo user
      email: demo@stackhpc.com
      name: demo
      password: *****
      roles:
      - member
      - reader
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/stack/.ansible/tmp/ansible-tmp-1755866974.7532272-708515-178033976670647/AnsiballZ_quota.py", line 107, in <module>
        _ansiballz_main()
      File "/home/stack/.ansible/tmp/ansible-tmp-1755866974.7532272-708515-178033976670647/AnsiballZ_quota.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/stack/.ansible/tmp/ansible-tmp-1755866974.7532272-708515-178033976670647/AnsiballZ_quota.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.openstack.cloud.plugins.modules.quota', init_globals=dict(_module_fqn='ansible_collections.openstack.cloud.plugins.modules.quota', _modlib_path=modlib_path),
      File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_openstack.cloud.quota_payload_85q5nn83/ansible_openstack.cloud.quota_payload.zip/ansible_collections/openstack/cloud/plugins/modules/quota.py", line 560, in <module>
      File "/tmp/ansible_openstack.cloud.quota_payload_85q5nn83/ansible_openstack.cloud.quota_payload.zip/ansible_collections/openstack/cloud/plugins/modules/quota.py", line 556, in main
      File "/tmp/ansible_openstack.cloud.quota_payload_85q5nn83/ansible_openstack.cloud.quota_payload.zip/ansible_collections/openstack/cloud/plugins/module_utils/openstack.py", line 417, in __call__
      File "/tmp/ansible_openstack.cloud.quota_payload_85q5nn83/ansible_openstack.cloud.quota_payload.zip/ansible_collections/openstack/cloud/plugins/modules/quota.py", line 536, in run
      File "/home/stack/openstack-config/ansible/openstack-config-venv/lib64/python3.9/site-packages/openstack/block_storage/v3/_proxy.py", line 1741, in update_quota_set
        return res.commit(self, **query)
      File "/home/stack/openstack-config/ansible/openstack-config-venv/lib64/python3.9/site-packages/openstack/resource.py", line 1793, in commit
        request = self._prepare_request(
      File "/home/stack/openstack-config/ansible/openstack-config-venv/lib64/python3.9/site-packages/openstack/resource.py", line 1251, in _prepare_request
        uri = base_path % self._uri.attributes
    KeyError: 'project_id'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
Ngôn ngữ chính
Jinja
Star
5
Fork
8
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stackhpc/openstack-config

Tất cả issue của stackhpc/openstack-config

Issue tương tự

Thêm issue về Cloud

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.