]> git.proxmox.com Git - pve-common.git/commitdiff
print_property_string: don't print the default key's name
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 May 2016 09:33:45 +0000 (11:33 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 23 May 2016 04:24:46 +0000 (06:24 +0200)
We had this behavior in the past and didn't mean to change
it.

src/PVE/JSONSchema.pm

index 5131e4dc07b7ed27c855950c681e4c81b79fffc5..a2394f74ede21d9f49105f876f42e3b32bf05d0d 100644 (file)
@@ -1601,7 +1601,7 @@ sub print_property_string {
     my $done = { map { $_ => 1 } @$skip };
 
     my $cond_add_key = sub {
-       my ($key) = @_;
+       my ($key, $isdefault) = @_;
 
        return if $done->{$key}; # avoid duplicates
 
@@ -1633,11 +1633,15 @@ sub print_property_string {
        die "internal error" if defined($phash->{alias});
 
        my $value_str = &$format_value($key, $value, $phash->{format});
-       &$add_option_string("$key=${value_str}");
+       if ($isdefault) {
+           &$add_option_string($value_str);
+       } else {
+           &$add_option_string("$key=${value_str}");
+       }
     };
 
     # add default key first
-    &$cond_add_key($default_key) if defined($default_key);
+    &$cond_add_key($default_key, 1) if defined($default_key);
 
     # add required keys first
     foreach my $key (sort keys %$data) {