Skip to content

Commit

Permalink
Merge pull request #253 from Dany9966/licence-diagnostics
Browse files Browse the repository at this point in the history
Add licensing information in diagnostics output
  • Loading branch information
Dany9966 authored Mar 14, 2023
2 parents 4f2a60b + efd13e4 commit e94d995
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions coriolis/conductor/rpc/server.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.

import contextlib
import copy
import functools
import itertools
import random
import time
import uuid

from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging

from coriolis import constants
from coriolis import context
from coriolis.db import api as db_api
Expand All @@ -28,7 +24,6 @@
from coriolis import utils
from coriolis.worker.rpc import client as rpc_worker_client


VERSION = "1.0"

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -3628,7 +3623,18 @@ def update_replica(
return self.get_replica_tasks_execution(ctxt, replica_id, execution.id)

def get_diagnostics(self, ctxt):
return utils.get_diagnostics_info()
diagnostics = utils.get_diagnostics_info()
if self._licensing_client:
diagnostics['licensing_status'] = (
self._licensing_client.get_licence_status())
diagnostics['licences'] = self._licensing_client.get_licences()
diagnostics['reservations'] = (
self._licensing_client.get_reservations())
else:
LOG.debug(
"Licensing client not instantiated. Cannot add licensing "
"information to diagnostics.")
return diagnostics

def create_region(self, ctxt, region_name, description="", enabled=True):
region = models.Region()
Expand Down

0 comments on commit e94d995

Please sign in to comment.