Skip to content

Commit

Permalink
force --logout on mount, to overcome inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Jun 3, 2010
1 parent e1b13dc commit ad758fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cosmic
Expand Up @@ -7,7 +7,7 @@ use Pod::Usage;

use App::Cosmic::Client;

our $VERSION = '0.01_05';
our $VERSION = '0.01_06';

pod2usage(1)
unless @ARGV;
Expand Down
11 changes: 10 additions & 1 deletion lib/App/Cosmic/Client.pm
Expand Up @@ -331,12 +331,21 @@ sub _mount {
for my $node (map {
_parse_node($_)->{host}
} sort @$nodes) {
# mount iscsi target
# mount iscsi target by doing:
# step 1) sendtargets
# step 2) logout (just in case, don't check errors)
# step 3) login
systeml(
qw(iscsiadm --mode=discovery --type=sendtargets),
"--portal=$node",
) == 0
or die "iscsiadm failed:$?";
systeml(
qw(iscsiadm --mode=node),
"--portal=$node",
'--target=' . to_iqn($node, $self->global_name),
'--logout',
);
systeml(
qw(iscsiadm --mode=node),
"--portal=$node",
Expand Down

0 comments on commit ad758fe

Please sign in to comment.