zmc / ceph-devstack

MIT License
3 stars 1 forks source link

macos: using ceph-devstack as a package has problems because of where logging.conf is placed #5

Closed VallariAg closed 2 months ago

VallariAg commented 5 months ago

I am using macos branch of ceph-devstack as a package. I'm basically following the REAMDE and doing:

git clone https://github.com/ceph/teuthology/
cd teuthology && ./bootstrap
python3 -m venv venv
source ./venv/bin/activate
python3 -m pip install git+https://github.com/zmc/ceph-devstack.git@macos       <----- using macos branch 

When I run any command like ceph-devstack show-conf or ceph-devstack doctor, I get:

Traceback (most recent call last):
File "/root/src/teuthology/venv/bin/ceph-devstack", line 5, in <module>
from ceph_devstack.cli import main
File "/root/src/teuthology/venv/lib64/python3.9/site-packages/ceph_devstack/init.py", line 11, in <module>
logging.config.fileConfig("./logging.conf")
File "/usr/lib64/python3.9/logging/config.py", line 71, in fileConfig
formatters = _create_formatters(cp)
File "/usr/lib64/python3.9/logging/config.py", line 104, in _create_formatters
flist = cp["formatters"]["keys"]
File "/usr/lib64/python3.9/configparser.py", line 963, in getitem
raise KeyError(key)
KeyError: 'formatters'

I inspected this and found that the logging.conf is missing from virtual env's packaged ceph-devstack (basically /root/src/teuthology/venv/lib64/python3.9/site-packages/ceph_devstack). I was able to fix this problem by simply doing this: https://github.com/VallariAg/ceph-devstack/commit/407e5e0aa4f4d1aea4cbc71ceccce4b83992b6b9 The above commit fixed this problem. I'm not sure if I should open a PR for this because I'm unsure if this is the correct solution. I was looking into creating a MANIFEST.in file to include logging.conf but that wasn't working for some reason. Hence, I'm looking for thoughts on the above commit before I dig deeper on ways to fix this (and also to see if others are able to replicate the problem or if I'm the lucky one!)

VallariAg commented 2 months ago

The fix is in the main branch: https://github.com/zmc/ceph-devstack/commit/686ed2846e6f8b2d1f045a5b19d528bd98c43e61