Skip to content

Commit d3c6272

Browse files
author
Dave Storey
committed
added logic to prevent mount point duplication
1 parent 546bc56 commit d3c6272

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

databricks/mounts.go

+5
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ func NewAzureADLSGen2Mount(containerName string, storageAccountName string, dire
308308
// Create creates a azure datalake gen 2 storage mount
309309
func (m AzureADLSGen2Mount) Create(client *service.DBApiClient, clusterID string) error {
310310
iamMountCommand := fmt.Sprintf(`
311+
for mount in dbutils.fs.mounts():
312+
if mount.mountPoint == "/mnt/%[9]s" and mount.source=="abfss://%[6]s@%[7]s.dfs.core.windows.net%[8]s":
313+
print ("Mount already exists")
314+
dbutils.notebook.exit("success")
315+
311316
try:
312317
configs = {"fs.azure.account.auth.type": "OAuth",
313318
"fs.azure.account.oauth.provider.type": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",

0 commit comments

Comments
 (0)