From 9f5238037a1afa9b1e5407c95466f20f7b990b41 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 17 Jan 2018 22:20:39 +0800 Subject: [PATCH] qa/tasks/ceph: ignore failure when chown ceph:ceph 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 --- qa/tasks/ceph.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 177fb0d2db2..c6336d5d18d 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -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( -- 2.39.5