]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs/first-damage: default conf if CEPH_CONF not set 63194/head
authorDan van der Ster <dan.vanderster@clyso.com>
Fri, 9 May 2025 02:46:02 +0000 (19:46 -0700)
committerDan van der Ster <dan.vanderster@clyso.com>
Fri, 9 May 2025 02:46:02 +0000 (19:46 -0700)
If $CEPH_CONF isn't set, you get:

unable to get monitor info from DNS SRV with service name: ceph-mon
2025-05-08T22:40:06.091-0400 7f604286f1c0 -1 failed for service _ceph-mon._tcp
2025-05-08T22:40:06.091-0400 7f604286f1c0 -1 monclient: get_monmap_and_config cannot identify monitors to contact
Traceback (most recent call last):
  File "/root/first-damage.py", line 144, in <module>
    R.connect()
  File "rados.pyx", line 690, in rados.Rados.connect
rados.ObjectNotFound: [errno 2] RADOS object not found (error connecting to the cluster)

Make it default to /etc/ceph/ceph.conf if the env isn't set.

Signed-off-by: Dan van der Ster <dan.vanderster@clyso.com>
src/tools/cephfs/first-damage.py

index 6207b5c1793684b3ef3a3ed8b11f7c7944a70666..763ab5af7f66845f2fce8a42c632aada3e4f68c0 100644 (file)
@@ -56,7 +56,7 @@ MEMO = None
 REMOVE = False
 POOL = None
 NEXT_SNAP = None
-CONF = os.environ.get('CEPH_CONF')
+CONF = os.environ.get('CEPH_CONF', '/etc/ceph/ceph.conf')
 REPAIR_NOSNAP = None
 
 CEPH_NOSNAP = 0xfffffffffffffffe # int64 -2