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
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)