Skip to content

Commit

Permalink
Update awx/main/utils/plugins.py
Browse files Browse the repository at this point in the history
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
  • Loading branch information
djyasin and webknjaz authored Oct 1, 2024
1 parent 8eb6164 commit ef8b63a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions awx/main/utils/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
This module contains the code responsible for extracting the lists of dynamically discovered plugins.
"""

CLOUD_PROVIDERS = []
from functools import cache


def discover_available_cloud_provider_plugin_names():
global CLOUD_PROVIDERS
from awx.main.models.inventory import InventorySourceOptions
@cache
def discover_available_cloud_provider_plugin_names() -> list[str]:
"""Return a list of cloud plugin names available in runtime.
plugin_names = list(InventorySourceOptions.injectors.keys())
The discovery result is cached since it does not change throughout
the life cycle of the server run.
:returns: List of plugin cloud names.
:rtype: list[str]
"""
from awx.main.models.inventory import InventorySourceOptions

CLOUD_PROVIDERS = plugin_names
return list(InventorySourceOptions.injectors.keys())

0 comments on commit ef8b63a

Please sign in to comment.