]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/ceph: ignore failure when chown ceph:ceph
authorKefu Chai <kchai@redhat.com>
Wed, 17 Jan 2018 14:20:39 +0000 (22:20 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Jan 2018 15:55:35 +0000 (23:55 +0800)
we didn't have ceph:ceph user back in hammer. so ignore this error.
ceph-common will create this user in newer version. and `ceph` task will
take care of this, when upgrading to a newer version.

Fixes: http://tracker.ceph.com/issues/22597
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph.py

index 177fb0d2db2d04dad6d5ca2239d32135751d6552..c6336d5d18d3ba1b30bb4ffcc7497f81cb3775de 100644 (file)
@@ -796,9 +796,14 @@ def cluster(ctx, config):
             )
             mnt_point = DATA_PATH.format(
                 type_='osd', cluster=cluster_name, id_=id_)
-            remote.run(args=[
-                'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
-            ])
+            try:
+                remote.run(args=[
+                    'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
+                ])
+            except run.CommandFailedError as e:
+                # hammer does not have ceph user, so ignore this error
+                log.info('ignoring error when chown ceph:ceph,'
+                         'probably installing hammer: %s', e)
 
     log.info('Reading keys from all nodes...')
     keys_fp = StringIO()
@@ -890,9 +895,14 @@ def cluster(ctx, config):
                     '--keyring', keyring_path,
                 ],
             )
-            remote.run(args=[
-                'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
-            ])
+            try:
+                remote.run(args=[
+                    'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
+                ])
+            except run.CommandFailedError as e:
+                # hammer does not have ceph user, so ignore this error
+                log.info('ignoring error when chown ceph:ceph,'
+                         'probably installing hammer: %s', e)
 
     run.wait(
         mons.run(