1. 27 May, 2022 1 commit
  2. 05 May, 2022 1 commit
  3. 05 Apr, 2022 1 commit
  4. 22 Mar, 2022 1 commit
  5. 15 Mar, 2022 1 commit
    • melanie witt's avatar
      Move Enforcer caching closer to limit retrieval · c67c9cf0
      melanie witt authored
      In change I22234e0bb6b3a1cecb29a6b99a3afcd02ffdbf5f added a
      get_registered_limits() interface but missed making it work with the
      Enforcer cache because caching was implemented in a higher layer,
      _get_limit() and get_registered_limits() could not make use of
      _get_limit().
      
      This moves the caching logic to where limits are retrieved from
      keystone, so that get_registered_limits() will use caching and any
      interfaces that might be added in the future will be able to benefit
      from using the cache.
      
      Closes-Bug: #1964848
      
      Change-Id: I28cdd4d3f4927b94acea3309b36999850cf2ee2a
      c67c9cf0
  6. 08 Mar, 2022 2 commits
  7. 04 Mar, 2022 2 commits
  8. 03 Mar, 2022 1 commit
  9. 27 Feb, 2022 1 commit
    • Takashi Kajinami's avatar
      oslo-config-generator: Fix ValueError · ce5aa7dc
      Takashi Kajinami authored
      This fixes how the opts data is formatted to fix auto-generation of
      config file using oslo-config-generator with oslo.limit entry point.
      
      Closes-Bug: #1962406
      Change-Id: I176a7b2b8e2edb50659783a2139c3cc13e8f2f53
      ce5aa7dc
  10. 21 Jan, 2022 2 commits
    • melanie witt's avatar
      Add interfaces for getting limits without enforcing · bf9deb10
      melanie witt authored
      We currently have a public Enforcer interface for getting limits and
      calculating usage but it is not yet possible to retrieve only limits
      without calculating usage.
      
      While working on unified limits support in nova, we realized we need a
      way to get limits only. In nova there are legacy APIs for showing quota
      limits and initially we will provide compat by proxying to keystone to
      get the limits.
      
      This adds public interfaces for getting limits to Enforcer.
      
      Related to blueprint unified-limits-nova
      
      Change-Id: I22234e0bb6b3a1cecb29a6b99a3afcd02ffdbf5f
      bf9deb10
    • Dan Smith's avatar
      Allow project_id=None for enforce/calculate · 7e4f36ab
      Dan Smith authored
      This allows a caller to pass None for the project_id if it only wants
      it to check the registered limit for a given resource. This is useful
      for non-project-scoped resourced where we just want to make sure some
      global limit hasn't been exceeded. This would also be relevant for
      resources that are created by system-scoped users, such as host
      aggregates.
      
      Change-Id: I5fea0143b6a96b5f79bc273961e3e284a260e25e
      7e4f36ab
  11. 10 Jan, 2022 3 commits
    • Dan Smith's avatar
      Make calculate_usage() work if limits are missing · a49f3a04
      Dan Smith authored
      The calculate_usage interface was added recently to allow consumers
      to probe limits and usage without requiring the enforce behavior
      workflow. If a limit was passed to it that was not registered in
      keystone, get_project_limits() would raise a ProjectOverLimit
      exception itself to abort the process immediately, providing the
      "unregistered means zero" behavior. This works fine for the enforce
      workflow, but not the calculate one.
      
      This changes get_project_limits() to just return a zero limit for
      a missing one, which will be considered by the enforce workflow in
      the same way, keeping the existing behavior. It will merely be
      reported by the calculate workflow, which is the desired change.
      
      Change-Id: Iaab1f0d5eb0da9a667267537d86f6c70bc8db51d
      a49f3a04
    • Zuul's avatar
      Merge "Add auth plugin options to options list" · ca8df2af
      Zuul authored
      ca8df2af
    • Zuul's avatar
      Merge "Add caching of limits in Enforcer" · 36b9ca3c
      Zuul authored
      36b9ca3c
  12. 18 Oct, 2021 1 commit
    • melanie witt's avatar
      Add caching of limits in Enforcer · 43683f54
      melanie witt authored
      This adds caching of resource limits for an Enforcer in order to
      improve performance when repeated limit checks are needed. The cache
      lasts the lifetime of an Enforcer and is enabled by default. It can be
      disabled by passing cache=False when instantiating an Enforcer.
      
      One usage pattern for a caching Enforcer would be to create an Enforcer
      per service request so that the caching lives only as long as the
      request.
      
      Change-Id: I8e43dceec76aecd2b2ae23a137e56519efe29777
      43683f54
  13. 11 Oct, 2021 1 commit
    • Takashi Kajinami's avatar
      Add auth plugin options to options list · ea5ff2dc
      Takashi Kajinami authored
      Currently the oslo.config.opts entry_points provided by oslo.limit
      doesn't include options for auth plugins, thus the parameters to
      define credentials like username, password and etc are not picked up by
      oslo-config-generator.
      
      This adds the options for auth plugin options to the entry point so
      that the auth parameters are included by the generated config files
      and users can easily find the parameters to define the required user
      credential.
      
      Note that keystoneauth provides several plugins but this change covers
      only password plugins, assuming the password authentication is most
      popularly used.
      
      Change-Id: Ib440f58b589076677be9e90dd960cd4459e63746
      ea5ff2dc
  14. 05 Oct, 2021 1 commit
  15. 04 Oct, 2021 1 commit
  16. 10 Sep, 2021 2 commits
  17. 13 Aug, 2021 1 commit
    • wangzihao's avatar
      setup.cfg: Replace dashes with underscores · a7d8f411
      wangzihao authored
      Setuptools v54.1.0 introduces a warning that the use of
      dash-separated options in 'setup.cfg' will not be supported
      in a future version [1].
      Get ahead of the issue by replacing the dashes with underscores.
      Without this, we see 'UserWarning' messages
      like the following on new enough
      versions of setuptools:
      
      UserWarning: Usage of dash-separated 'description-file' will not be
      supported in future versions. Please use the underscore name
      'description_file' instead
      [1]https://github.com/pypa/setuptools/commit/a2e9ae4cb
      
      Change-Id: I2ea9570dcf018c484054d8078f6e5a767b23dd82
      a7d8f411
  18. 12 Aug, 2021 1 commit
  19. 09 Jun, 2021 1 commit
    • Dan Smith's avatar
      Add a test fixture · caa75c1b
      Dan Smith authored
      This adds a fixture that can be used by consuming projects to
      simulate a set of limits in keystone, without requiring actual
      keystone. Currently, consumers have to mock oslo.limit internals (at
      least) in order to do testing.
      
      Change-Id: If72050e90ca8b03e26d128c7bbcef6bbea92b501
      caa75c1b
  20. 07 Jun, 2021 1 commit
    • Dan Smith's avatar
      Add Enforcer.calculate_usage() · 1175b0f7
      Dan Smith authored
      In multiple situations, it is necessary to be able to probe the limits
      set for a project without actually enforcing. Examples:
      
      1. Exposing a usage API where we want to not only report the current
         usage, but the limit as well. Otherwise clients have to do their
         own calls to keystone and correlation to get a single integer
         limit value, which we should be able to expose for them.
      2. When checking quota as part of a long-running process of consuming
         an unbounded data stream, we need to be able to determine how much
         quota remains so that we can stop the transfer if we exceed the
         limit. Without this, we have to periodically call to keystone
         during the transfer, which is expensive and could fail.
      
      This patch adds a calculate_usage() method to the Enforcer which
      calculates the usage using the enforcement model and returns a
      mapping of resource names to namedtuples that contain limit and usage
      information.
      
      Change-Id: Ic0632cc5ec52aefb85a04f879651963bfa54dcbe
      1175b0f7
  21. 18 May, 2021 1 commit
  22. 16 Apr, 2021 3 commits
  23. 15 Apr, 2021 2 commits
  24. 23 Mar, 2021 1 commit
  25. 14 Jan, 2021 1 commit
  26. 03 Jan, 2021 1 commit
  27. 02 Dec, 2020 1 commit
    • likui's avatar
      add py38 matedata · e4583b63
      likui authored
      Change-Id: I86ffd71d9c5cdda410d654fe9b0bb46ad12eeb05
      e4583b63
  28. 03 Nov, 2020 1 commit
  29. 16 Oct, 2020 1 commit
    • zhoulinhui's avatar
      Fix hacking min version to 3.0.1 · 592a0d09
      zhoulinhui authored
      flake8 new release 3.8.0 added new checks and gate pep8
      job start failing. hacking 3.0.1 fix the pinning of flake8 to
      avoid bringing in a new version with new checks.
      
      Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
      flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
      break the pep8 job if new check are added.
      
      To avoid similar gate break in future, we need to bump the hacking min
      version.
      
      - http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
      
      Change-Id: I70ca30dd0a5bf0f1aa44f627d92038c826b67174
      592a0d09
  30. 23 Sep, 2020 1 commit
    • maaoyu's avatar
      Remove install unnecessary packages · 9558a46c
      maaoyu authored
      The docs requirements migrated to doc/requirements.txt
      we need not install things from requirements.txt.
      
      Change-Id: Ia65109bbb683489ba9a880d3a41baca5ef560d77
      9558a46c
  31. 22 Sep, 2020 1 commit