Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion functions/size_to_bytes.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function lvm::size_to_bytes (
'E' => 1.1529215e18,
}
# Check if the size is valid and if so, extract the units
if $size =~ /^([0-9]+(\.[0-9]+)?)([KMGTPEkmgtpe])/ {
if $size =~ /^<?([0-9]+(\.[0-9]+)?)([KMGTPEkmgtpe])/ {
$unit = String($3, '%u') # Store the units in uppercase
$number = Float($1) # Store the number as a float

Expand All @@ -20,3 +20,4 @@ function lvm::size_to_bytes (
fail("${size} is not a valid LVM size")
}
}