Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 182126

There is a bug in VICommon.pm in get_property subroutine

$
0
0

Hello

 

VICommon.pm get_properties (line 1702 in build 1384587) the lines in bold prefixed ++ are what I add locally to avoid this problem

 

sub get_property {

   my ($self, $path) = @_;

   my @subpaths = ();

   my $val;

   while ($path) {

      if (exists $self->{$path}) {

         $val = $self->{$path};

         last;

      } elsif ($path =~ /^(.+)\.([^.]+)$/) {

         $path = $1;

         unshift @subpaths, $2;

++   } else {

++       last;

      }

   }

   if (defined($val)) {

      foreach (@subpaths) {

         $val = $val->{$_};

      }

   }

   return $val;

}

 

This bug causes a infinite loop when the value of $path is neither in the $self object/hash or matches the regex.

 

I get this quite a lot with values that show up as Undef in the mob object browser.  for example if a datastore summary object does not have uncommitted info available or a NIC has no IP address and I try to look at it via VMs guest data

 

My fix is less than elegant as I have to catch the return being undefined so perhaps someone can propose something better.

 

 

Neil


Viewing all articles
Browse latest Browse all 182126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>