1
0
mirror of synced 2026-04-29 21:36:55 +00:00

Refactoring: xt-create-xen-config: Use s/// to strip trailing MB size suffixes

This commit is contained in:
Axel Beckert
2013-10-28 22:28:40 +01:00
parent c82cb31adc
commit 2c020323f6
2 changed files with 4 additions and 8 deletions

View File

@@ -369,10 +369,7 @@ sub createXenConfig
#
# Remove any trailing Mb.
#
if ( $ENV{ 'memory' } =~ /^(\d+)Mb?.*$/i )
{
$ENV{ 'memory' } = $1;
}
$ENV{ 'memory' } =~ s/^(\d+)Mb?.*$/$1/i;
#
# The maxmem size: Convert Gb -> Mb.
@@ -387,10 +384,7 @@ sub createXenConfig
#
# Remove any trailing Mb.
#
if ( $ENV{ 'maxmem' } =~ /^(\d+)Mb?.*$/i )
{
$ENV{ 'maxmem' } = $1;
}
$ENV{ 'maxmem' } =~ s/^(\d+)Mb?.*$/$1/i;
}
#