From ffb766b296e2bf1cf9bd76d5c15214c62e4e1e07 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 (cherry picked from commit 9f5238037a1afa9b1e5407c95466f20f7b990b41) --- 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 e53adcf31a7..92bff4201f0 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -815,9 +815,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() @@ -909,9 +914,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.47.3