]> git.proxmox.com Git - pve-container.git/commitdiff
Use the new JSONSchema::print_property_string
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 1 Oct 2015 08:58:28 +0000 (10:58 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Oct 2015 09:29:38 +0000 (11:29 +0200)
src/PVE/LXC.pm

index dd39e49a91027bc2d208ee87bfbe1f717612a68d..428433a1cb865bff6b21e018de4bf24f64db2825 100644 (file)
@@ -882,37 +882,13 @@ sub parse_ct_mountpoint {
 
 sub print_ct_mountpoint {
     my ($info, $nomp) = @_;
-
-    my $opts = '';
-
-    die "missing volume\n" if !$info->{volume};
-
-    foreach my $o (qw(backup)) {
-       $opts .= ",$o=$info->{$o}" if defined($info->{$o});
-    }
-
-    if ($info->{size}) {
-       $opts .= ",size=" . &$format_size($info->{size});
-    }
-
-    $opts .= ",mp=$info->{mp}" if !$nomp;
-
-    return "$info->{volume}$opts";
+    my $skip = $nomp ? ['mp'] : [];
+    return PVE::JSONSchema::print_property_string($info, $mp_desc, $skip);
 }
 
 sub print_lxc_network {
     my $net = shift;
-
-    die "no network name defined\n" if !$net->{name};
-
-    my $res = "name=$net->{name}";
-
-    foreach my $k (qw(hwaddr mtu bridge ip gw ip6 gw6 firewall tag)) {
-       next if !defined($net->{$k});
-       $res .= ",$k=$net->{$k}";
-    }
-
-    return $res;
+    return PVE::JSONSchema::print_property_string($net, $netconf_desc);
 }
 
 sub parse_lxc_network {