]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-daemon: avoid py3-isms
authorSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 12:45:41 +0000 (07:45 -0500)
committerSage Weil <sage@redhat.com>
Mon, 28 Oct 2019 17:15:47 +0000 (12:15 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon

index 6dfc456c004732a889fbafc92ec2363cd341dad8..b3e8ac79a077d40c254fb05855854896070884db 100755 (executable)
@@ -201,7 +201,7 @@ def make_log_dir(fsid, uid=None, gid=None):
 def find_program(filename):
     name = find_executable(filename)
     if name is None:
-        raise ValueError(f'{filename} not found')
+        raise ValueError('%s not found' % filename)
     return name
 
 def get_unit_name(fsid, daemon_type, daemon_id):
@@ -668,11 +668,11 @@ class CephContainer:
 
     def run_cmd(self):
         vols = sum(
-            [['-v', f'{host_dir}:{container_dir}']
+            [['-v', '%s:%s' % (host_dir, container_dir)]
              for host_dir, container_dir in self.volume_mounts.items()], [])
         envs = [
-            '-e', f'CONTAINER_IMAGE={self.image}',
-            '-e', f'NODE_NAME={get_hostname()}',
+            '-e', 'CONTAINER_IMAGE=%s' % self.image,
+            '-e', 'NODE_NAME=%s' % get_hostname(),
         ]
         cname = ['--name', self.cname] if self.cname else []
         return [
@@ -687,11 +687,11 @@ class CephContainer:
 
     def shell_cmd(self, cmd):
         vols = sum(
-            [['-v', f'{host_dir}:{container_dir}']
+            [['-v', '%s:%s' % (host_dir, container_dir)]
              for host_dir, container_dir in self.volume_mounts.items()], [])
         envs = [
-            '-e', f'CONTAINER_IMAGE={self.image}',
-            '-e', f'NODE_NAME={get_hostname()}',
+            '-e', 'CONTAINER_IMAGE=%s' % self.image,
+            '-e', 'NODE_NAME=%s' % get_hostname(),
         ]
         cmd_args = []
         if cmd:
@@ -726,7 +726,7 @@ class CephContainer:
 
 def command_version():
     out = CephContainer(args.image, 'ceph', ['--version']).run()
-    print(out, end='')
+    print(out.strip())
     return 0
 
 ##################################