Skip to content

Commit

Permalink
added logic to prevent mount point duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Storey committed Jun 9, 2020
1 parent 546bc56 commit d3c6272
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions databricks/mounts.go
Expand Up @@ -308,6 +308,11 @@ func NewAzureADLSGen2Mount(containerName string, storageAccountName string, dire
// Create creates a azure datalake gen 2 storage mount
func (m AzureADLSGen2Mount) Create(client *service.DBApiClient, clusterID string) error {
iamMountCommand := fmt.Sprintf(`
for mount in dbutils.fs.mounts():
if mount.mountPoint == "/mnt/%[9]s" and mount.source=="abfss://%[6]s@%[7]s.dfs.core.windows.net%[8]s":
print ("Mount already exists")
dbutils.notebook.exit("success")
try:
configs = {"fs.azure.account.auth.type": "OAuth",
"fs.azure.account.oauth.provider.type": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",
Expand Down

0 comments on commit d3c6272

Please sign in to comment.