Hello,
First of all, thank you for this script !
I had a few issues running the script with python 3 on Centos 7.
$ python3 -V
Python 3.6.8
- Error loading remapped pgs
$ python3 scripts/upmap-remapped.py
Error loading remapped pgs
The output of subprocess.check_output is of type byte, so it needs to be decoded before being able to use split:
for line in subprocess.check_output(['ceph', 'osd', 'pool', 'ls', 'detail']).split('\n'):
OSDS is not a list
For the same reason, OSDS is byte and not list :
OSDS = subprocess.check_output(['ceph', 'osd', 'ls', '-f', 'json'])
- Harmful cast in
valid_osds
Casting osds to str is useless and breaks the lookup in :
def valid_osds(osds):
valid = []
for osd in osds:
if str (osd) in OSDS:
valid.append(osd)
return valid
I'll submit a PR with the various fixes.
Hello,
First of all, thank you for this script !
I had a few issues running the script with python 3 on Centos 7.
The output of
subprocess.check_outputis of typebyte, so it needs to be decoded before being able to usesplit:OSDSis not a listFor the same reason, OSDS is
byteand notlist:valid_osdsCasting
osdstostris useless and breaks the lookup in :I'll submit a PR with the various fixes.