def get_available_port(curr_port, ports_dict):
    """Method to recursively check for available
       ports in provided ports_dict

    :param curr_port: port to be replaced
    :type curr_port: str
    :param ports_dict: dict to check available ports
    :type ports_dict: dict
    :return: next available port
    :rtype: str
    """
    # Check if port is not available, recursively check for
    # next available port
    if curr_port in ports_dict:
        return get_available_port(str(int(curr_port)+1), ports_dict)
    # If port is available, append it to non-available ports dict
    # and return
    else:
        ports_dict.append(curr_port)
        return curr_port