docs: def connect_by_mapping(self, si, vm, mapping, default_network, reserved_networks, logger, promiscuous_mode):
          """
          gets the mapping to the vnics and connects it to the vm
          :param default_network:
          :param si: ServiceInstance
          :param vm: vim.VirtualMachine
          :param mapping: [VmNetworkMapping]
          :param reserved_networks:
          :param logger:
          :param promiscuous_mode <str> 'True' or 'False' turn on/off promiscuous mode for the port group
          """
          request_mapping = []
  
          logger.debug(
              'about to map to the vm: {0}, the following networks'.format(vm.name if vm.name else vm.config.uuid))
  
          for network_map in mapping:
              network = self.dv_port_group_creator.get_or_create_network(si,
                                                                         vm,
                                                                         network_map.dv_port_name,
                                                                         network_map.dv_switch_name,
                                                                         network_map.dv_switch_path,
                                                                         network_map.vlan_id,
                                                                         network_map.vlan_spec,
                                                                         logger,
                                                                         promiscuous_mode)
  
              request_mapping.append(ConnectRequest(network_map.vnic_name, network))
  
          logger.debug(str(request_mapping))
          return self.virtual_machine_port_group_configurer.connect_vnic_to_networks(vm,
                                                                                     request_mapping,
                                                                                     default_network,
                                                                                     reserved_networks,
                                                                                     logger)