mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 10:33:46 +00:00
Merge pull request #31 from krzysztof-magosa/hyphen-storage
allow using hyphen in storage names
This commit is contained in:
commit
3e6eb46905
@ -15,6 +15,7 @@ BUG FIXES:
|
||||
* resource/virtual_environment_container: Fix VM ID collision when `vm_id` is not specified
|
||||
* resource/virtual_environment_vm: Fix VM ID collision when `vm_id` is not specified
|
||||
* resource/virtual_environment_vm: Fix disk import issue when importing from directory-based datastores
|
||||
* resource/virtual/environment/vm: Fix handling of storage name - correct handling of `-`
|
||||
|
||||
WORKAROUNDS:
|
||||
|
||||
|
@ -1625,7 +1625,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int
|
||||
fmt.Sprintf(`file_path="%s"`, filePath),
|
||||
fmt.Sprintf(`file_path_tmp="%s"`, filePathTmp),
|
||||
fmt.Sprintf(`vm_id="%d"`, vmID),
|
||||
`getdsi() { local nr='^([A-Za-z0-9_]+): ([A-Za-z0-9_]+)$'; local pr='^[[:space:]]+path[[:space:]]+([^[:space:]]+)$'; local dn=""; local dt=""; while IFS='' read -r l || [[ -n "$l" ]]; do if [[ "$l" =~ $nr ]]; then dt="${BASH_REMATCH[1]}"; dn="${BASH_REMATCH[2]}"; elif [[ "$l" =~ $pr ]] && [[ "$dn" == "$1" ]]; then echo "${BASH_REMATCH[1]};${dt}"; break; fi; done < /etc/pve/storage.cfg; }`,
|
||||
`getdsi() { local nr='^([A-Za-z0-9_-]+): ([A-Za-z0-9_-]+)$'; local pr='^[[:space:]]+path[[:space:]]+([^[:space:]]+)$'; local dn=""; local dt=""; while IFS='' read -r l || [[ -n "$l" ]]; do if [[ "$l" =~ $nr ]]; then dt="${BASH_REMATCH[1]}"; dn="${BASH_REMATCH[2]}"; elif [[ "$l" =~ $pr ]] && [[ "$dn" == "$1" ]]; then echo "${BASH_REMATCH[1]};${dt}"; break; fi; done < /etc/pve/storage.cfg; }`,
|
||||
`dsi_image="$(getdsi "$datastore_id_image")"`,
|
||||
`dsp_image="$(echo "$dsi_image" | cut -d ";" -f 1)"`,
|
||||
`dst_image="$(echo "$dsi_image" | cut -d ";" -f 2)"`,
|
||||
|
Loading…
Reference in New Issue
Block a user