def del_nic(self, nic, sync=True):
        """
        delete nic from this OS instance
        :param nic: the nic to be deleted from this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the nic object on list to be removed on next save().
        :return:
        """
        LOGGER.debug("OSInstance.del_nic")
        if not sync:
            self.nic_2_rm.append(nic)
        else:
            if nic.id is None:
                nic.sync()
            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/delete', 'parameters': params}
                response = OSInstanceService.requester.call(args)
                if response.rc != 0:
                    LOGGER.warning(
                        'OSInstance.del_nic - Problem while updating OS instance ' + self.name +
                        '. Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                        " (" + str(response.rc) + ")"
                    )
                else:
                    self.nic_ids.remove(nic.id)
                    nic.nic_osi_id = None
            else:
                LOGGER.warning(
                    'OSInstance.del_nic - Problem while updating OS instance ' + self.name + '. Reason: NIC ' +
                    nic.name + ' id is None'
                )
def del_nic ( self , nic , sync = True ) : LOGGER . debug ( "OSInstance.del_nic" ) if not sync : self . nic_2_rm . append ( nic ) else : if nic . id is None : nic . sync ( ) 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/delete' , 'parameters' : params } response = OSInstanceService . requester . call ( args ) if response . rc != 0 : LOGGER . warning ( 'OSInstance.del_nic - Problem while updating OS instance ' + self . name + '. Reason: ' + str ( response . response_content ) + '-' + str ( response . error_message ) + " (" + str ( response . rc ) + ")" ) else : self . nic_ids . remove ( nic . id ) nic . nic_osi_id = None else : LOGGER . warning ( 'OSInstance.del_nic - Problem while updating OS instance ' + self . name + '. Reason: NIC ' + nic . name + ' id is None' )
delete nic from this OS instance
        :param nic: the nic to be deleted from this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the nic object on list to be removed on next save().
        :return: