]> git.proxmox.com Git - pve-container.git/commitdiff
Fix warning if restore from OpenVZ
authorWolfgang Link <w.link@proxmox.com>
Fri, 31 Jul 2015 09:47:40 +0000 (11:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 31 Jul 2015 10:19:47 +0000 (12:19 +0200)
src/PVE/API2/LXC.pm
src/PVE/LXCCreate.pm
src/PVE/VZDump/ConvertOVZ.pm

index 3e4e862a9cd98879502a72368cc2438e71aa446c..3bde6c1100bd7d45a49e413f3a2b94c3346434f5 100644 (file)
@@ -241,9 +241,10 @@ __PACKAGE__->register_method({
        }
 
        my $conf = {};
-       
+       my $ovs;
+
        if ($restore) {
-           $conf = PVE::LXCCreate::recover_config($archive);
+           ($conf, $ovs) = PVE::LXCCreate::recover_config($archive);
            PVE::LXC::lxc_config_change_vmid($conf, $vmid);
        }
 
@@ -279,7 +280,12 @@ __PACKAGE__->register_method({
            PVE::Cluster::check_cfs_quorum();
 
            $param->{disk} = $conf->{'pve.disksize'} if !$param->{disk} && $restore;
-
+           if($ovs) {
+                  print "###########################################################\n";
+                  print "Converting OpenVZ configuration to LXC.\n";
+                  print "Please check the configuration and reconfigure the network.\n";
+                  print "###########################################################\n";
+           }
            PVE::LXCCreate::create_rootfs($storage_cfg, $storage, $param->{disk}, $vmid, $conf, 
                                          $archive, $password, $restore);
        };
index ad5fcbc7f315624582dcb5653158a07b7562e3bd..3096008ed260dc49f44a83155fc516a9bd22b0e8 100644 (file)
@@ -106,6 +106,7 @@ sub recover_config {
 
     my $conf_file = tar_archive_search_conf($archive);
 
+    my $ovs;
     my $raw = '';
     my $out = sub {
        my $output = shift;
@@ -125,7 +126,7 @@ sub recover_config {
            delete $conf->{snapshots};
 
     } elsif ($conf_file =~ m/vps\.conf/) {
-
+       $ovs = 1;
        $conf = PVE::VZDump::ConvertOVZ::convert_ovz($raw);
 
     } else {
@@ -133,7 +134,7 @@ sub recover_config {
        die "internal error";
     }
 
-    return $conf;
+    return $conf, $ovs;
 }
 
 sub restore_and_configure {
index 3b078bf1685f10655d0ce94a103fadc100cff248..85f747a91888237f92b294524b0781adb3a6c15a 100644 (file)
@@ -296,11 +296,6 @@ my $parse_ovz_config = sub {
 sub convert_ovz {
    my ($raw) = @_;
 
-   print "###########################################################\n";
-   print "Converting OpenVZ configuration to LXC.\n";
-   print "Please check the configuration and reconfigure the network.\n";
-   print "###########################################################\n";
-
    my $conf = {};
 
    my $ovz_conf = &$parse_ovz_config($raw);