]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
exporter: fix run-tox-cephadm/mgr
authorAvan Thakkar <athakkar@redhat.com>
Mon, 25 Apr 2022 18:54:54 +0000 (00:24 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Mon, 20 Jun 2022 18:24:54 +0000 (23:54 +0530)
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
src/cephadm/cephadm
src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/cephadm/tests/test_services.py

index dfcddc1690aa3055cf5c1abd1bca7ce36a328e47..efb7513870c40f2af2567f39bace88614c196d2c 100755 (executable)
@@ -928,7 +928,7 @@ class CephExporter(object):
     def __init__(self,
                  ctx: CephadmContext,
                  fsid: str, daemon_id: Union[int, str],
-                 image=DEFAULT_IMAGE) -> None:
+                 image: str = DEFAULT_IMAGE) -> None:
         self.ctx = ctx
         self.fsid = fsid
         self.daemon_id = daemon_id
index efaa601a147d3e23f7411a522c8818f9987892ab..c26e5ee51311ce4eab34812f93072e9b5fff931b 100644 (file)
@@ -466,7 +466,7 @@ class CephService(CephadmService):
             return AuthEntity(f'client.{self.TYPE}.{host}')
         elif self.TYPE == 'mon':
             return AuthEntity('mon.')
-        elif self.TYPE in ['mgr', 'osd', 'mds']:
+        elif self.TYPE in ['mgr', 'osd', 'mds', 'ceph-exporter']:
             return AuthEntity(f'{self.TYPE}.{daemon_id}')
         else:
             raise OrchestratorError("unknown daemon type")
index 69ee8a9944ee77349abd85065862ec64dc2d8b04..a31b5bdb894e516356d44cb665ea13acbfe61a56 100644 (file)
@@ -391,6 +391,7 @@ class TestMonitoring:
 
         with with_host(cephadm_module, 'test'):
             with with_service(cephadm_module, MonitoringSpec('node-exporter')) as _, \
+                    with_service(cephadm_module, ServiceSpec('ceph-exporter')) as _, \
                     with_service(cephadm_module, MonitoringSpec('prometheus')) as _:
 
                 y = dedent("""
@@ -413,6 +414,11 @@ class TestMonitoring:
                       labels:
                         instance: 'test'
 
+                  - job_name: 'ceph-exporter'
+                    static_configs:
+                    - targets:
+                      - '[1::4]:9926'
+
                 """).lstrip()
 
                 _run_cephadm.assert_called_with(