move assert_if_modified to PVE::Tools

This commit is contained in:
Dietmar Maurer 2014-04-10 09:42:21 +02:00
parent 97ffb83b4d
commit a345b9d584
2 changed files with 9 additions and 3 deletions

View File

@ -428,9 +428,7 @@ sub write_config {
sub assert_if_modified {
my ($cfg, $digest) = @_;
if ($digest && ($cfg->{digest} ne $digest)) {
die "detected modified configuration - file change by other user? Try again.\n";
}
PVE::Tools::assert_if_modified($cfg->{digest}, $digest);
}
1;

View File

@ -998,4 +998,12 @@ sub dir_glob_foreach {
}
}
sub assert_if_modified {
my ($digest1, $digest2) = @_;
if ($digest1 && $digest2 && ($digest1 ne $digest2)) {
die "detected modified configuration - file change by other user? Try again.\n";
}
}
1;