From eb1e9e2410a7ac2ee2acd020f3d650eee165c282 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 13 Jun 2021 17:07:22 +0800 Subject: [PATCH] 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 --- src/pybind/ceph_argparse.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 947bddf010b..a29fc00b198 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -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)