Exemple #1
0
 def _service_instance_update_props(self, si, nprops):
     old_ifs = si.params.get('interface_list', [])
     new_ifs = nprops.get_interface_list()
     update = False
     if len(new_ifs) != len(old_ifs):
         update = True
     else:
         for index, new_if in enumerate(new_ifs):
             if new_if.get_ip_address() != old_ifs[index]['ip_address']:
                 update = True
                 break
             if new_if.get_virtual_network() != \
                old_ifs[index]['virtual_network']:
                 update = True
                 break
     if update:
         si_obj = ServiceInstance(name=si.name, parent_type='project')
         si_obj.uuid = si.uuid
         si_obj.set_service_instance_properties(nprops)
         self._api.service_instance_update(si_obj)
         si.update()
 def _service_instance_update_props(self, si, nprops):
     old_ifs = si.params.get('interface_list', [])
     new_ifs = nprops.get_interface_list()
     update = False
     if len(new_ifs) != len(old_ifs):
         update = True
     else:
         for index, new_if in enumerate(new_ifs):
             if new_if.get_ip_address() != old_ifs[index]['ip_address']:
                 update = True
                 break
             if new_if.get_virtual_network() != \
                old_ifs[index]['virtual_network']:
                 update = True
                 break
     if update:
         si_obj = ServiceInstance(name=si.name, parent_type='project')
         si_obj.uuid = si.uuid
         si_obj.set_service_instance_properties(nprops)
         self._api.service_instance_update(si_obj)
         si.update()