]> git.proxmox.com Git - pve-common.git/commitdiff
rename variable
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 15 May 2017 07:31:08 +0000 (09:31 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Sep 2017 11:45:41 +0000 (13:45 +0200)
to prevent confusion of rendered type text vs. original type
property

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/RESTHandler.pm

index 119e26ee3556eecb910a67afff79821560b0099b..d700976082655f3c4f9078fd78ef3793b88a01c4 100644 (file)
@@ -409,16 +409,16 @@ my $get_property_description = sub {
 
     chomp $descr;
 
 
     chomp $descr;
 
-    my $type = PVE::JSONSchema::schema_get_type_text($phash, $style);
+    my $type_text = PVE::JSONSchema::schema_get_type_text($phash, $style);
 
     if ($hidepw && $name eq 'password') {
 
     if ($hidepw && $name eq 'password') {
-       $type = '';
+       $type_text = '';
     }
 
     if ($fileparams && $phash->{type} eq 'string') {
        foreach my $elem (@$fileparams) {
            if ($name eq $elem) {
     }
 
     if ($fileparams && $phash->{type} eq 'string') {
        foreach my $elem (@$fileparams) {
            if ($name eq $elem) {
-               $type = '<filepath>';
+               $type_text = '<filepath>';
                last;
            }
        }
                last;
            }
        }
@@ -438,7 +438,7 @@ my $get_property_description = sub {
            die "unknown style '$style'";
        }
 
            die "unknown style '$style'";
        }
 
-       $res .= "`$type` " if $type;
+       $res .= "`$type_text` " if $type_text;
 
        if (defined(my $dv = $phash->{default})) {
            $res .= "('default =' `$dv`)";
 
        if (defined(my $dv = $phash->{default})) {
            $res .= "('default =' `$dv`)";
@@ -480,7 +480,7 @@ my $get_property_description = sub {
            die "unknown style '$style'";
        }
 
            die "unknown style '$style'";
        }
 
-       my $tmp = sprintf "  %-10s %s$defaulttxt\n", $display_name, "$type";
+       my $tmp = sprintf "  %-10s %s$defaulttxt\n", $display_name, "$type_text";
        my $indend = "             ";
 
        $res .= Text::Wrap::wrap('', $indend, ($tmp));
        my $indend = "             ";
 
        $res .= Text::Wrap::wrap('', $indend, ($tmp));
@@ -558,7 +558,7 @@ sub usage_str {
        next if $arg_hash->{$k};
        next if defined($fixed_param->{$k});
 
        next if $arg_hash->{$k};
        next if defined($fixed_param->{$k});
 
-       my $type = $prop->{$k}->{type} || 'string';
+       my $type_text = $prop->{$k}->{type} || 'string';
 
        next if $hidepw && ($k eq 'password') && !$prop->{$k}->{optional};
 
 
        next if $hidepw && ($k eq 'password') && !$prop->{$k}->{optional};
 
@@ -578,7 +578,7 @@ sub usage_str {
 
        if (!$prop->{$k}->{optional}) {
            $args .= " " if $args;
 
        if (!$prop->{$k}->{optional}) {
            $args .= " " if $args;
-           $args .= "-$base <$type>"
+           $args .= "-$base <$type_text>"
        }
     } 
 
        }
     }