def add_ip_address(self, ip_address, sync=True):
        """
        add a ip address to this OS instance.
        :param ip_address: the ip address to add on this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the subnet object on list to be added on next save().
        :return:
        """
        LOGGER.debug("OSInstance.add_ip_address")
        if not sync:
            self.ip_address_2_add.append(ip_address)
        else:
            if ip_address.id is None:
                ip_address.save()
            if self.id is not None and ip_address.id is not None:
                params = {
                    'id': self.id,
                    'ipAddressID': ip_address.id
                }
                args = {'http_operation': 'GET', 'operation_path': 'update/ipAddresses/add', 'parameters': params}
                response = OSInstanceService.requester.call(args)
                if response.rc != 0:
                    LOGGER.warning(
                        'OSInstance.add_ip_address - Problem while updating OS instance ' + self.name +
                        '. Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                        " (" + str(response.rc) + ")"
                    )
                else:
                    self.ip_address_ids.append(ip_address.id)
                    ip_address.ipa_os_instance_id = self.id
            else:
                LOGGER.warning(
                    'OSInstance.add_ip_address - Problem while updating OS instance ' +
                    self.name + '. Reason: IP Address ' + ip_address.ipAddress + ' id is None'
                )
def add_ip_address ( self , ip_address , sync = True ) : LOGGER . debug ( "OSInstance.add_ip_address" ) if not sync : self . ip_address_2_add . append ( ip_address ) else : if ip_address . id is None : ip_address . save ( ) if self . id is not None and ip_address . id is not None : params = { 'id' : self . id , 'ipAddressID' : ip_address . id } args = { 'http_operation' : 'GET' , 'operation_path' : 'update/ipAddresses/add' , 'parameters' : params } response = OSInstanceService . requester . call ( args ) if response . rc != 0 : LOGGER . warning ( 'OSInstance.add_ip_address - Problem while updating OS instance ' + self . name + '. Reason: ' + str ( response . response_content ) + '-' + str ( response . error_message ) + " (" + str ( response . rc ) + ")" ) else : self . ip_address_ids . append ( ip_address . id ) ip_address . ipa_os_instance_id = self . id else : LOGGER . warning ( 'OSInstance.add_ip_address - Problem while updating OS instance ' + self . name + '. Reason: IP Address ' + ip_address . ipAddress + ' id is None' )
add a ip address to this OS instance.
        :param ip_address: the ip address to add on this OS instance
        :param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
        add the subnet object on list to be added on next save().
        :return: