Skip to content

Commit

Permalink
Update Utils.pm Mojo::File::spurt Mojo::File::spew
Browse files Browse the repository at this point in the history
Mojo::File::spurt is deprecated in favor of Mojo::File::spew
  • Loading branch information
moetiker authored Nov 10, 2023
1 parent 11448ca commit 97d432c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Zadm/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ my $edit = sub($self, $config) {
my $suf = $self->gconf->{CONFIG}->{format} || 'json';
my $fh = File::Temp->new(SUFFIX => ".$suf", OPEN => 0);
my $file = Mojo::File->new($fh->filename);
$file->spurt($config);
$file->spew($config);

my $mtime = $file->stat->mtime;

Expand Down Expand Up @@ -330,7 +330,7 @@ sub edit($self, $zone, $prop = {}) {
# restoring the zone XML config since it was changed but something went wrong
if ($backmod && $backmod != $xml->stat->mtime) {
$self->log->warn('WARNING: restoring the zone config.');
$xml->spurt($backcfg);
$xml->spew($backcfg);

return 0;
}
Expand Down Expand Up @@ -385,7 +385,7 @@ sub edit($self, $zone, $prop = {}) {
# restoring the zone XML config since it was changed but something went wrong
if ($backmod && $backmod != $xml->stat->mtime) {
$self->log->warn('WARNING: restoring the zone config.');
$xml->spurt($backcfg);
$xml->spew($backcfg);
}

return 0;
Expand Down Expand Up @@ -433,7 +433,7 @@ sub getZfsProp($self, $ds, $prop = []) {

sub getFileType($self, $data, $suffix = '') {
my $f = Mojo::File->new(File::Temp->new($suffix ? (SUFFIX => $suffix) : ()));
$f->spurt($data);
$f->spew($data);

return $self->readProc('file', [ '-b', $f ])->[0];
}
Expand Down

0 comments on commit 97d432c

Please sign in to comment.