diff --git a/bin/xt-create-xen-config b/bin/xt-create-xen-config index df8d0a7..a47a741 100755 --- a/bin/xt-create-xen-config +++ b/bin/xt-create-xen-config @@ -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; } # diff --git a/debian/changelog b/debian/changelog index 088bebd..7d482d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low * Abort early and with proper error message if "xen-delete-image --test" is not used with "--dir". (Closes: #704878) * xen-delete-image: Exit with return code != 0 in all error cases. + * Refactoring: xt-create-xen-config: Use s/// to strip trailing MB size + suffixes. * Bump Standards-Version to 3.9.5 (no changes). -- Axel Beckert Fri, 23 Aug 2013 21:13:07 +0200