mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
pybind/ceph_argparse: cast to strs before joining them
we cannot concat a list of float or int by joining them with "|". Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
ce823359ce
commit
eb1e9e2410
@ -256,8 +256,7 @@ class CephInt(CephArgtype):
|
||||
if range == '':
|
||||
self.range = list()
|
||||
else:
|
||||
self.range = list(range.split('|'))
|
||||
self.range = [int(x) for x in self.range]
|
||||
self.range = [int(x) for x in range.split('|')]
|
||||
|
||||
def valid(self, s, partial=False):
|
||||
try:
|
||||
@ -283,7 +282,7 @@ class CephInt(CephArgtype):
|
||||
|
||||
def argdesc(self, attrs):
|
||||
if self.range:
|
||||
attrs['range'] = '|'.join(self.range)
|
||||
attrs['range'] = '|'.join(str(v) for v in self.range)
|
||||
return super().argdesc(attrs)
|
||||
|
||||
|
||||
@ -296,8 +295,7 @@ class CephFloat(CephArgtype):
|
||||
if range == '':
|
||||
self.range = list()
|
||||
else:
|
||||
self.range = list(range.split('|'))
|
||||
self.range = [float(x) for x in self.range]
|
||||
self.range = [float(x) for x in range.split('|')]
|
||||
|
||||
def valid(self, s, partial=False):
|
||||
try:
|
||||
@ -322,7 +320,7 @@ class CephFloat(CephArgtype):
|
||||
|
||||
def argdesc(self, attrs):
|
||||
if self.range:
|
||||
attrs['range'] = '|'.join(self.range)
|
||||
attrs['range'] = '|'.join(str(v) for v in self.range)
|
||||
return super().argdesc(attrs)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user