add a nic to this OS instance.
        :param nic: the nic to add on this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the nic object on list to be added on next save().
        :return:

def add_nic(self, nic, sync=True):
        """
        add a nic to this OS instance.
        :param nic: the nic to add on this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the nic object on list to be added on next save().
        :return:
        """
        LOGGER.debug("OSInstance.add_nic")
        if not sync:
            self.nic_2_add.append(nic)
        else:
            if nic.id is None:
                nic.save()
            if self.id is not None and nic.id is not None:
                params = {
                    'id': self.id,
                    'nicID': nic.id
                }
                args = {'http_operation': 'GET', 'operation_path': 'update/nics/add', 'parameters': params}
                response = OSInstanceService.requester.call(args)
                if response.rc != 0:
                    LOGGER.warning(
                        'OSInstance.add_nic - Problem while updating OS instance ' + self.name +
                        '. Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                        " (" + str(response.rc) + ")"
                    )
                else:
                    self.nic_ids.append(nic.id)
                    nic.nic_osi_id = self.id
            else:
                LOGGER.warning(
                    'OSInstance.add_nic - Problem while updating OS instance ' + self.name +
                    '. Reason: NIC ' + nic.name + ' id is None'
                )