From: Wolfgang Bumiller Date: Thu, 19 May 2016 09:33:45 +0000 (+0200) Subject: print_property_string: don't print the default key's name X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=971353e8ac4191a6ea7125b4c7240cd6387060bd print_property_string: don't print the default key's name We had this behavior in the past and didn't mean to change it. --- diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 5131e4d..a2394f7 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -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) {