0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-22 19:38:35 +00:00

virtual_environment_datastores.go: Update remote command to get datasource path (#49)

This commit fixes the shell command that is being executed to get the datasource
path which appears to be no longer functional.

The previous command assumed that "path" is going to be the next line after the
datasource name, leaving NFS mounts and other types of mount points non-functional.
This commit is contained in:
Matt Burchett 2022-03-21 19:26:39 -05:00 committed by GitHub
parent 75e01de8f3
commit 065e859227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,7 +167,7 @@ func (c *VirtualEnvironmentClient) UploadFileToDatastore(d *VirtualEnvironmentDa
}
buf, err := sshSession.CombinedOutput(
fmt.Sprintf(`grep -Pzo ': %s\s+path\s+[^\s]+' /etc/pve/storage.cfg | grep -Pzo '/[^\s]*' | tr -d '\000'`, d.DatastoreID),
fmt.Sprintf(`awk "/.+: %s$/,/^$/" /etc/pve/storage.cfg | grep -oP '(?<=path[ ])[^\s]+' | head -c -1`, d.DatastoreID),
)
if err != nil {