From: Eric Harney Date: Mon, 21 Jan 2013 21:50:31 +0000 (-0500) Subject: Improve error message for missing NFS share config X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bf6f0d5f368dd79e8e5a8883b9bb0d24d7434cf4;p=openstack-build%2Fcinder-build.git Improve error message for missing NFS share config If FLAGS.nfs_share_config is not defined, the error will reference the name of the config option to set. If the nfs_share_config path doesn't exist, the error will reference the path that was configured. This will hopefully simplify troubleshooting of NFS configuration. Change-Id: Ica6a60a63330554dc880f36962f3a081926ce5cf --- diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index e47c5714f..1d757cbfb 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -57,9 +57,12 @@ class NfsDriver(driver.VolumeDriver): config = FLAGS.nfs_shares_config if not config: - LOG.warn(_("There's no NFS config file configured ")) - if not config or not os.path.exists(config): - msg = _("NFS config file doesn't exist") + msg = (_("There's no NFS config file configured (%s)") % + 'nfs_shares_config') + LOG.warn(msg) + raise exception.NfsException(msg) + if not os.path.exists(config): + msg = _("NFS config file at %(config)s doesn't exist") % locals() LOG.warn(msg) raise exception.NfsException(msg)