Skip to content

Commit

Permalink
Added version information for Pulp plugins to Status API
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Mar 13, 2018
1 parent e7885fe commit 3cae996
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pulpcore/pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@
'pulpcore.app',
]

# add plugins to INSTALLED_APPS after pulpcore
# Enumerate the installed Pulp plugins during the loading process for use in the status API
INSTALLED_PULP_PLUGINS = []

for entry_point in iter_entry_points('pulpcore.plugin'):
plugin_app_config = entry_point.load()
INSTALLED_PULP_PLUGINS.append(entry_point.module_name)
INSTALLED_APPS.append(plugin_app_config)

# Optional apps that help with development, or augment Pulp in some non-critical way
Expand Down
11 changes: 8 additions & 3 deletions pulpcore/pulpcore/app/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from pulpcore.app.models.task import Worker
from pulpcore.app.serializers.status import StatusSerializer
from pulpcore.app.settings import INSTALLED_PULP_PLUGINS
from pulpcore.tasking.celery_instance import celery


Expand All @@ -23,10 +24,14 @@ class StatusView(APIView):

def get(self, request, format=None):
"""
Returns app information including the version, known workers, database connection status,
and messaging connection status
Returns app information including the version of pulpcore and loaded pulp plugins,
known workers, database connection status, and messaging connection status
"""
versions = [{'component': 'pulpcore', 'version': get_distribution("pulpcore").version}]
components = ['pulpcore'] + INSTALLED_PULP_PLUGINS
versions = [{
'component': component,
'version': get_distribution(component).version
} for component in components]
broker_status = {'connected': self._get_broker_conn_status()}
db_status = {'connected': self._get_db_conn_status()}

Expand Down

0 comments on commit 3cae996

Please sign in to comment.