]> git.proxmox.com Git - pve-common.git/commitdiff
move assert_if_modified to PVE::Tools
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Apr 2014 07:42:21 +0000 (09:42 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Apr 2014 07:42:21 +0000 (09:42 +0200)
data/PVE/SectionConfig.pm
data/PVE/Tools.pm

index c338a9332d7c71e5b4a3e6c98a072cc2667eec52..f0bf23f86c9f90f761dc73a21eafd9342a47d6dd 100644 (file)
@@ -428,9 +428,7 @@ sub write_config {
 sub assert_if_modified {
     my ($cfg, $digest) = @_;
 
 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;
 }
 
 1;
index 622f8ad02cd430763b5b577e6722436b8cc7489a..7448183455f5a1c2e23bdccfc9fdffa0adaa0872 100644 (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;
 1;