graceful dbutils mount/unmount

dchokkadi1_5588
New Contributor II

Is there a way to indicate to dbutils.fs.mount to not throw an error if the mount is already mounted?

And viceversa, for unmount to not throw an error if it is already unmounted?

I am trying to run my notebook as a job and it has a init section that mounts S3 buckets it needs. Sometimes the mounts are already done by an earlier script.

Since mounting an already mounted mount (wow) throws an error my job exits out.