* Updated Convert->human_readable_to_bytes() to return an empty string if passed an empty string.
Signed-off-by: digimer <digimer@gravitar.alteeve.com>
<keyname="job_0439"><![CDATA[Missing '--os <os_variant>'. Valid options match 'virt-install --os-variant' (run: 'osinfo-query os' and reference the 'Short ID' column).]]></key>
<keyname="job_0440"><![CDATA[The OS: [#!variable!os!#] was not found. If you're sure the OS is valid, please run 'striker-parse-os-list --xml --new' and add the output to 'words.xml'.]]></key>
<keyname="job_0447"><![CDATA[- The requested storage group: [#!variable!storage_group!#] does not appear to be valid. Valid options are:]]></key>
<keyname="job_0448"><![CDATA[Missing '--storage-size <bytes or human readable>'. Max is: [#!variable!storage_group_size!#].]]></key>
<keyname="job_0449"><![CDATA[Missing '--storage-size <bytes or human readable>'. Max will depend on selected --storage-group.]]></key>
<keyname="job_0450"><![CDATA[The requested disk size: [#!variable!storage_size!#] is not valid. Must be between: [10MiB] and: [#!variable!max_size!#].]]></key>
<keyname="job_0451"><![CDATA[Missing '--install-media <file_name or file_uuid>'. Valid options are:]]></key>
print "Missing '--os <os_variant>', valid options match 'virt-install --os-variant' (run: 'osinfo-query os' and reference the 'Short ID' column).\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
@ -2895,18 +2897,28 @@ sub interactive_ask_server_confirm
}});
if ($os_name =~ /#!not_found/)
{
print "The OS: [".$anvil->data->{switches}{os}."] was not found. If you're sure the OS is valid, please run 'striker-parse-os-list --xml --new' and add the output to 'words.xml'.\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
elsif (($anvil->data->{switches}{cpu} =~ /\D/) or ($anvil->data->{switches}{cpu} > $anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{threads}) or ($anvil->data->{switches}{cpu} < 1))
{
print "The number of CPU cores: [".$anvil->data->{switches}{cpu}."] is invalid. Must be between 1 and ".$anvil->data->{anvil_resources}{$anvil_uuid}{cpu}{threads}.".\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
print "The requested RAM: [".$anvil->data->{switches}{ram}."] is not valid. Must be between: [64KiB] and: [".$say_max_ram."]\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
foreach my $storage_group_name (sort {$a cmp $b} keys %{$anvil->data->{anvil_resources}{$anvil_uuid}{storage_group_name}})
{
print "- Name: [".$storage_group_name."], UUID: [".$anvil->data->{anvil_resources}{$anvil_uuid}{storage_group_name}{$storage_group_name}{storage_group_uuid}."]\n" if not $anvil->data->{switches}{options};
@ -2972,10 +2995,16 @@ sub interactive_ask_server_confirm
else
{
# Invalid
print "- The requested storage group: [".$storage_group."] does not appear to be valid. Valid options are;\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
foreach my $storage_group_name (sort {$a cmp $b} keys %{$anvil->data->{anvil_resources}{$anvil_uuid}{storage_group_name}})
{
print "- Name: [".$storage_group_name."], UUID: [".$anvil->data->{anvil_resources}{$anvil_uuid}{storage_group_name}{$storage_group_name}{storage_group_uuid}."]\n" if not $anvil->data->{switches}{options};
@ -3005,7 +3037,11 @@ sub interactive_ask_server_confirm
($requested_disk > $max_storage_group_size))
{
# Invalid
print "The requested disk size: [".$anvil->data->{switches}{'storage-size'}."] is not valid. Must be between: [10MiB] and: [".$say_max_storage_group_size."]\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
@ -3045,7 +3093,10 @@ sub interactive_ask_server_confirm
else
{
# Not an ISO.
print "The install file: [".$anvil->data->{switches}{'install-media'}."] is not an ISO, so it can't be used to install.\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;
@ -3082,7 +3150,10 @@ sub interactive_ask_server_confirm
else
{
# Not an ISO.
print "The driver file: [".$anvil->data->{switches}{'driver-disc'}."] is not an ISO, so it can't be used as an optical disc.\n" if not $anvil->data->{switches}{options};
my $print = $anvil->data->{switches}{options} ? 0 : 1;