diff --git a/tools/Makefile.am b/tools/Makefile.am index 6c51c2d7..cd2b412f 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,7 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in # XXX recheck after rebase! -EXTRA_DIST = \ dist_sbin_SCRIPTS = \ anvil-access-module \ diff --git a/tools/anvil-manage-server-storage b/tools/anvil-manage-server-storage index 2f956b28..d32b26a8 100755 --- a/tools/anvil-manage-server-storage +++ b/tools/anvil-manage-server-storage @@ -406,6 +406,21 @@ sub manage_optical my $device_target = $anvil->data->{switches}{optical}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { device_target => $device_target }}); + if ($anvil->data->{switches}{optical} eq "#!SET!#") + { + # User didn't specify a device. + show_server_details($anvil); + print "\n[ Error ] - Please specify the optical disk target you want to work on.\n"; + $anvil->nice_exit({exit_code => 1}); + } + elsif (not exists $anvil->data->{server}{$short_host_name}{$server_name}{$from_source}{device}{cdrom}{target}{$device_target}) + { + # Invalid device target + show_server_details($anvil); + print "\n[ Error ] - The optical device target: [".$device_target."] wasn't found.\n"; + $anvil->nice_exit({exit_code => 1}); + } + my $eject_first = 0; my $alias = $anvil->data->{server}{$short_host_name}{$server_name}{$from_source}{device}{cdrom}{target}{$device_target}{alias}; my $boot_order = $anvil->data->{server}{$short_host_name}{$server_name}{$from_source}{device}{cdrom}{target}{$device_target}{boot_order};