Quantcast
Channel: VMware Communities : Unanswered Discussions - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 872

warning if some object are empty in NetworkConfigSection

$
0
0

Hello,

 

When I execute a modification of the networkconfigsection of a deployed vapp, I have some warning messages if some objects are empty. But these object have to be empty for our purpose.

 

for example :

if I want to have a Natservice enabled but without NatRule,so I want to have something like this :

<NatService>
   <IsEnabled>true</IsEnabled>
   <NatType>portForwarding</NatType>
   <Policy>allowTraffic</Policy>
</NatService>

 

I've got this warning message :

PHP Warning:  Invalid argument supplied for foreach() in /home/yconan/e2cdelta/trunk/lib/library/VMware/VCloud-1.0.0-314767/API.php on line 4982

 

it seams that there is no test on $this->NatRule to know if it's set. For the moment I resolve this by adding something like this around line 4982:

if (isset ($this->NatRule))
        {
          foreach ($this->NatRule as $NatRule) {
              $tagName = $NatRule->get_tagName();
              if (empty($tagName)) {
                  $tagName = 'NatRule';
              }
              $out = $NatRule->export($out, $level, $tagName, '', $namespace, $rootNS);
          }
        }

 

But I'am not sure that is a good solution. Is there another method to create a Natservice without rules and without having these warning messages ?

 

I have the same problem :

when it is needed to have a NetworkConfig  section empty on line 22713 in API.php

when it is needed to have a NetworkConnection section empty on line 23525 in API.php

 

Regards,

 

Yann CONAN


Viewing all articles
Browse latest Browse all 872

Trending Articles



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