09:58:18 Triggered by Gerrit: https://git.opendaylight.org/gerrit/c/transportpce/+/120829 09:58:18 Running as SYSTEM 09:58:18 [EnvInject] - Loading node environment variables. 09:58:18 Building remotely on prd-ubuntu2204-docker-4c-16g-28057 (ubuntu2204-docker-4c-16g) in workspace /w/workspace/transportpce-tox-verify-transportpce-master 09:58:18 [ssh-agent] Looking for ssh-agent implementation... 09:58:18 [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) 09:58:18 $ ssh-agent 09:58:18 SSH_AUTH_SOCK=/tmp/ssh-XXXXXX9CxzbT/agent.1569 09:58:18 SSH_AGENT_PID=1571 09:58:18 [ssh-agent] Started. 09:58:18 Running ssh-add (command line suppressed) 09:58:18 Identity added: /w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_10252712615775021747.key (/w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_10252712615775021747.key) 09:58:18 [ssh-agent] Using credentials jenkins (jenkins-ssh) 09:58:18 The recommended git tool is: NONE 09:58:20 using credential jenkins-ssh 09:58:21 Wiping out workspace first. 09:58:21 Cloning the remote Git repository 09:58:21 Cloning repository git://devvexx.opendaylight.org/mirror/transportpce 09:58:21 > git init /w/workspace/transportpce-tox-verify-transportpce-master # timeout=10 09:58:21 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 09:58:21 > git --version # timeout=10 09:58:21 > git --version # 'git version 2.34.1' 09:58:21 using GIT_SSH to set credentials jenkins-ssh 09:58:21 Verifying host key using known hosts file, will automatically accept unseen keys 09:58:21 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce +refs/heads/*:refs/remotes/origin/* # timeout=10 09:58:25 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 09:58:25 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 09:58:25 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 09:58:25 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 09:58:25 using GIT_SSH to set credentials jenkins-ssh 09:58:25 Verifying host key using known hosts file, will automatically accept unseen keys 09:58:25 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce refs/changes/29/120829/15 # timeout=10 09:58:26 > git rev-parse 785fcb13938a447e501f47a0aa9a74a97736484f^{commit} # timeout=10 09:58:26 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script 09:58:26 Checking out Revision 785fcb13938a447e501f47a0aa9a74a97736484f (refs/changes/29/120829/15) 09:58:26 > git config core.sparsecheckout # timeout=10 09:58:26 > git checkout -f 785fcb13938a447e501f47a0aa9a74a97736484f # timeout=10 09:58:26 Commit message: "Support for openconfig 2.0" 09:58:26 > git rev-parse FETCH_HEAD^{commit} # timeout=10 09:58:26 > git rev-list --no-walk f6d12910d5094a7663243830395c69423a66f1b9 # timeout=10 09:58:26 > git remote # timeout=10 09:58:26 > git submodule init # timeout=10 09:58:26 > git submodule sync # timeout=10 09:58:26 > git config --get remote.origin.url # timeout=10 09:58:26 > git submodule init # timeout=10 09:58:26 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 09:58:26 ERROR: No submodules found. 09:58:30 provisioning config files... 09:58:30 copy managed file [npmrc] to file:/home/jenkins/.npmrc 09:58:30 copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf 09:58:30 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins3035447081566791612.sh 09:58:30 ---> python-tools-install.sh 09:58:30 Setup pyenv: 09:58:30 * system (set by /opt/pyenv/version) 09:58:30 * 3.8.20 (set by /opt/pyenv/version) 09:58:30 * 3.9.20 (set by /opt/pyenv/version) 09:58:30 3.10.15 09:58:30 3.11.10 09:58:35 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-pAmy 09:58:35 lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv 09:58:35 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 09:58:35 lf-activate-venv(): INFO: Attempting to install with network-safe options... 09:58:39 lf-activate-venv(): INFO: Base packages installed successfully 09:58:39 lf-activate-venv(): INFO: Installing additional packages: lftools 09:59:06 lf-activate-venv(): INFO: Adding /tmp/venv-pAmy/bin to PATH 09:59:06 Generating Requirements File 09:59:33 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. 09:59:33 httplib2 0.30.2 requires pyparsing<4,>=3.0.4, but you have pyparsing 2.4.7 which is incompatible. 09:59:33 Python 3.11.10 09:59:33 pip 26.1.2 from /tmp/venv-pAmy/lib/python3.11/site-packages/pip (python 3.11) 09:59:33 aiohappyeyeballs==2.6.2 09:59:33 aiohttp==3.14.1 09:59:33 aiosignal==1.4.0 09:59:33 appdirs==1.4.4 09:59:33 argcomplete==3.6.3 09:59:33 aspy.yaml==1.3.0 09:59:33 attrs==26.1.0 09:59:33 autopage==0.6.0 09:59:33 beautifulsoup4==4.15.0 09:59:33 boto3==1.43.31 09:59:33 botocore==1.43.31 09:59:33 bs4==0.0.2 09:59:33 certifi==2026.5.20 09:59:33 cffi==2.0.0 09:59:33 cfgv==3.5.0 09:59:33 chardet==7.4.3 09:59:33 charset-normalizer==3.4.7 09:59:33 click==8.4.1 09:59:33 cliff==4.14.0 09:59:33 cmd2==4.0.0 09:59:33 cryptography==3.3.2 09:59:33 debtcollector==3.1.0 09:59:33 decorator==5.3.1 09:59:33 defusedxml==0.7.1 09:59:33 Deprecated==1.3.1 09:59:33 distlib==0.4.3 09:59:33 dnspython==2.8.0 09:59:33 docker==7.1.0 09:59:33 dogpile.cache==1.5.0 09:59:33 durationpy==0.10 09:59:33 email-validator==2.3.0 09:59:33 filelock==3.29.4 09:59:33 frozenlist==1.8.0 09:59:33 future==1.0.0 09:59:33 gitdb==4.0.12 09:59:33 GitPython==3.1.50 09:59:33 httplib2==0.30.2 09:59:33 identify==2.6.19 09:59:33 idna==3.18 09:59:33 importlib-resources==1.5.0 09:59:33 iso8601==2.1.0 09:59:33 Jinja2==3.1.6 09:59:33 jmespath==1.1.0 09:59:33 jsonpatch==1.33 09:59:33 jsonpointer==3.1.1 09:59:33 jsonschema==4.26.0 09:59:33 jsonschema-specifications==2025.9.1 09:59:33 keystoneauth1==5.14.0 09:59:33 kubernetes==36.0.2 09:59:33 lftools==0.37.22 09:59:33 lxml==6.1.1 09:59:33 markdown-it-py==4.2.0 09:59:33 MarkupSafe==3.0.3 09:59:33 mdurl==0.1.2 09:59:33 msgpack==1.2.0 09:59:33 multi_key_dict==2.0.3 09:59:33 multidict==6.7.1 09:59:33 munch==4.0.0 09:59:33 netaddr==1.3.0 09:59:33 niet==1.4.2 09:59:33 nodeenv==1.10.0 09:59:33 oauth2client==4.1.3 09:59:33 oauthlib==3.3.1 09:59:33 openstacksdk==4.16.0 09:59:33 os-service-types==1.8.2 09:59:33 osc-lib==4.6.0 09:59:33 oslo.config==10.5.0 09:59:33 oslo.context==6.4.0 09:59:33 oslo.i18n==6.8.0 09:59:33 oslo.log==8.2.0 09:59:33 oslo.serialization==5.10.0 09:59:33 oslo.utils==10.1.1 09:59:33 packaging==26.2 09:59:33 pbr==7.0.3 09:59:33 platformdirs==4.10.0 09:59:33 prettytable==3.17.0 09:59:33 prompt_toolkit==3.0.52 09:59:33 propcache==0.5.2 09:59:33 psutil==7.2.2 09:59:33 pyasn1==0.6.3 09:59:33 pyasn1_modules==0.4.2 09:59:33 pycparser==3.0 09:59:33 pygerrit2==2.0.15 09:59:33 PyGithub==2.9.1 09:59:33 Pygments==2.20.0 09:59:33 PyJWT==2.13.0 09:59:33 PyNaCl==1.6.2 09:59:33 pyparsing==2.4.7 09:59:33 pyperclip==1.11.0 09:59:33 pyrsistent==0.20.0 09:59:33 python-cinderclient==9.9.0 09:59:33 python-dateutil==2.9.0.post0 09:59:33 python-discovery==1.4.2 09:59:33 python-heatclient==5.2.0 09:59:33 python-jenkins==1.8.3 09:59:33 python-keystoneclient==5.8.0 09:59:33 python-magnumclient==4.10.0 09:59:33 python-openstackclient==10.1.0 09:59:33 python-swiftclient==4.10.0 09:59:33 PyYAML==6.0.3 09:59:33 referencing==0.37.0 09:59:33 requests==2.34.2 09:59:33 requests-oauthlib==2.0.0 09:59:33 rfc3986==2.0.0 09:59:33 rich==15.0.0 09:59:33 rich-argparse==1.8.0 09:59:33 rpds-py==2026.5.1 09:59:33 rsa==4.9.1 09:59:33 ruamel.yaml==0.19.1 09:59:33 ruamel.yaml.clib==0.2.15 09:59:33 s3transfer==0.19.0 09:59:33 simplejson==4.1.1 09:59:33 six==1.17.0 09:59:33 smmap==5.0.3 09:59:33 soupsieve==2.8.4 09:59:33 stevedore==5.8.0 09:59:33 tabulate==0.10.0 09:59:33 toml==0.10.2 09:59:33 tomlkit==0.15.0 09:59:33 tqdm==4.68.3 09:59:33 typing_extensions==4.15.0 09:59:33 urllib3==1.26.20 09:59:33 virtualenv==21.5.1 09:59:33 wcwidth==0.8.1 09:59:33 websocket-client==1.9.0 09:59:33 wrapt==2.2.1 09:59:33 xdg==6.0.0 09:59:33 xmltodict==1.0.4 09:59:33 yarl==1.24.2 09:59:33 yq==3.4.3 09:59:34 [transportpce-tox-verify-transportpce-master] $ /bin/sh /tmp/jenkins1826482937683873001.sh 09:59:34 ---> uv-install.sh 09:59:34 Installing uv/uvx (latest) using shell installer 09:59:34 2026-06-17 09:59:34 URL:https://releases.astral.sh/installers/uv/latest/uv-installer.sh [71233/71233] -> "/tmp/uv-install-GI6YLs.sh" [1] 09:59:34 downloading uv 0.11.21 x86_64-unknown-linux-gnu 09:59:35 installing to /home/jenkins/.local/bin 09:59:35 uv 09:59:35 uvx 09:59:35 everything's installed! 09:59:35 09:59:35 To add $HOME/.local/bin to your PATH, either restart your shell or run: 09:59:35 09:59:35 source $HOME/.local/bin/env (sh, bash, zsh) 09:59:35 source $HOME/.local/bin/env.fish (fish) 09:59:35 Adding install location to PATH 09:59:35 ---> Validating uv/uvx install 09:59:35 uvx 0.11.21 (x86_64-unknown-linux-gnu) 09:59:35 [EnvInject] - Injecting environment variables from a build step. 09:59:35 [EnvInject] - Injecting as environment variables the properties content 09:59:35 PYTHON=python3 09:59:35 09:59:35 [EnvInject] - Variables injected successfully. 09:59:35 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins10420979761115012464.sh 09:59:35 ---> tox-install.sh 09:59:35 + source /home/jenkins/lf-env.sh 09:59:35 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 09:59:35 ++ mktemp -d /tmp/venv-XXXX 09:59:35 + lf_venv=/tmp/venv-R0aW 09:59:35 + local venv_file=/tmp/.os_lf_venv 09:59:35 + local python=python3 09:59:35 + local options 09:59:35 + local set_path=true 09:59:35 + local install_args= 09:59:35 ++ getopt -o np:v: -l no-path,system-site-packages,python:,venv-file: -n lf-activate-venv -- --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 09:59:35 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 09:59:35 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 09:59:35 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 09:59:35 + true 09:59:35 + case $1 in 09:59:35 + venv_file=/tmp/.toxenv 09:59:35 + shift 2 09:59:35 + true 09:59:35 + case $1 in 09:59:35 + shift 09:59:35 + break 09:59:35 + case $python in 09:59:35 + local pkg_list= 09:59:35 + [[ -d /opt/pyenv ]] 09:59:35 + echo 'Setup pyenv:' 09:59:35 Setup pyenv: 09:59:35 + export PYENV_ROOT=/opt/pyenv 09:59:35 + PYENV_ROOT=/opt/pyenv 09:59:35 + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:35 + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:35 + pyenv versions 09:59:35 system 09:59:35 3.8.20 09:59:35 3.9.20 09:59:35 3.10.15 09:59:35 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 09:59:35 + command -v pyenv 09:59:35 ++ pyenv init - --no-rehash 09:59:35 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 09:59:35 for i in ${!paths[@]}; do 09:59:35 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 09:59:35 fi; done; 09:59:35 echo "${paths[*]}"'\'')" 09:59:35 export PATH="/opt/pyenv/shims:${PATH}" 09:59:35 export PYENV_SHELL=bash 09:59:35 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 09:59:35 pyenv() { 09:59:35 local command 09:59:35 command="${1:-}" 09:59:35 if [ "$#" -gt 0 ]; then 09:59:35 shift 09:59:35 fi 09:59:35 09:59:35 case "$command" in 09:59:35 rehash|shell) 09:59:35 eval "$(pyenv "sh-$command" "$@")" 09:59:35 ;; 09:59:35 *) 09:59:35 command pyenv "$command" "$@" 09:59:35 ;; 09:59:35 esac 09:59:35 }' 09:59:35 +++ bash --norc -ec 'IFS=:; paths=($PATH); 09:59:35 for i in ${!paths[@]}; do 09:59:35 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 09:59:35 fi; done; 09:59:35 echo "${paths[*]}"' 09:59:35 ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:35 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:35 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:35 ++ export PYENV_SHELL=bash 09:59:35 ++ PYENV_SHELL=bash 09:59:35 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 09:59:35 +++ complete -F _pyenv pyenv 09:59:35 ++ lf-pyver python3 09:59:35 ++ local py_version_xy=python3 09:59:35 ++ local py_version_xyz= 09:59:35 ++ pyenv versions 09:59:35 ++ sed 's/^[ *]* //' 09:59:35 ++ local command 09:59:35 ++ command=versions 09:59:35 ++ '[' 1 -gt 0 ']' 09:59:35 ++ shift 09:59:35 ++ case "$command" in 09:59:35 ++ command pyenv versions 09:59:35 ++ grep -E '^[0-9.]*[0-9]$' 09:59:35 ++ awk '{ print $1 }' 09:59:35 ++ [[ ! -s /tmp/.pyenv_versions ]] 09:59:35 +++ grep '^3' /tmp/.pyenv_versions 09:59:35 +++ sort -V 09:59:35 +++ tail -n 1 09:59:35 ++ py_version_xyz=3.11.10 09:59:35 ++ [[ -z 3.11.10 ]] 09:59:35 ++ echo 3.11.10 09:59:35 ++ return 0 09:59:35 + pyenv local 3.11.10 09:59:35 + local command 09:59:35 + command=local 09:59:35 + '[' 2 -gt 0 ']' 09:59:35 + shift 09:59:35 + case "$command" in 09:59:35 + command pyenv local 3.11.10 09:59:35 + for arg in "$@" 09:59:35 + case $arg in 09:59:35 + pkg_list+='tox ' 09:59:35 + for arg in "$@" 09:59:35 + case $arg in 09:59:35 + pkg_list+='virtualenv ' 09:59:35 + for arg in "$@" 09:59:35 + case $arg in 09:59:35 + pkg_list+='urllib3~=1.26.15 ' 09:59:35 + [[ -f /tmp/.toxenv ]] 09:59:35 + [[ ! -f /tmp/.toxenv ]] 09:59:35 + [[ -n '' ]] 09:59:35 + python3 -m venv /tmp/venv-R0aW 09:59:39 + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-R0aW' 09:59:39 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-R0aW 09:59:39 + echo /tmp/venv-R0aW 09:59:39 + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' 09:59:39 lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv 09:59:39 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 09:59:39 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 09:59:39 + local 'pip_opts=--upgrade --quiet' 09:59:39 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 09:59:39 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 09:59:39 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 09:59:39 + [[ -n '' ]] 09:59:39 + [[ -n '' ]] 09:59:39 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 09:59:39 lf-activate-venv(): INFO: Attempting to install with network-safe options... 09:59:39 + /tmp/venv-R0aW/bin/python3 -m pip install --upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org pip 'setuptools<66' virtualenv 09:59:43 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 09:59:43 lf-activate-venv(): INFO: Base packages installed successfully 09:59:43 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 09:59:43 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 09:59:43 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 09:59:43 + /tmp/venv-R0aW/bin/python3 -m pip install --upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 09:59:46 + type python3 09:59:46 + true 09:59:46 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-R0aW/bin to PATH' 09:59:46 lf-activate-venv(): INFO: Adding /tmp/venv-R0aW/bin to PATH 09:59:46 + PATH=/tmp/venv-R0aW/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 + return 0 09:59:46 + python3 --version 09:59:46 Python 3.11.10 09:59:46 + python3 -m pip --version 09:59:46 pip 26.1.2 from /tmp/venv-R0aW/lib/python3.11/site-packages/pip (python 3.11) 09:59:46 + python3 -m pip freeze 09:59:46 cachetools==7.1.4 09:59:46 colorama==0.4.6 09:59:46 distlib==0.4.3 09:59:46 filelock==3.29.4 09:59:46 packaging==26.2 09:59:46 platformdirs==4.10.0 09:59:46 pluggy==1.6.0 09:59:46 pyproject-api==1.10.1 09:59:46 python-discovery==1.4.2 09:59:46 tomli_w==1.2.0 09:59:46 tox==4.55.1 09:59:46 urllib3==1.26.20 09:59:46 virtualenv==21.5.1 09:59:46 [transportpce-tox-verify-transportpce-master] $ /bin/sh -xe /tmp/jenkins8583671759360524233.sh 09:59:46 [EnvInject] - Injecting environment variables from a build step. 09:59:46 [EnvInject] - Injecting as environment variables the properties content 09:59:46 PARALLEL=True 09:59:46 09:59:46 [EnvInject] - Variables injected successfully. 09:59:46 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins14901892584203567729.sh 09:59:46 ---> tox-run.sh 09:59:46 + PATH=/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 + ARCHIVE_TOX_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 09:59:46 + ARCHIVE_DOC_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 09:59:46 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 09:59:46 + cd /w/workspace/transportpce-tox-verify-transportpce-master/. 09:59:46 + source /home/jenkins/lf-env.sh 09:59:46 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 09:59:46 ++ mktemp -d /tmp/venv-XXXX 09:59:46 + lf_venv=/tmp/venv-BKRI 09:59:46 + local venv_file=/tmp/.os_lf_venv 09:59:46 + local python=python3 09:59:46 + local options 09:59:46 + local set_path=true 09:59:46 + local install_args= 09:59:46 ++ getopt -o np:v: -l no-path,system-site-packages,python:,venv-file: -n lf-activate-venv -- --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 09:59:46 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 09:59:46 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 09:59:46 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 09:59:46 + true 09:59:46 + case $1 in 09:59:46 + venv_file=/tmp/.toxenv 09:59:46 + shift 2 09:59:46 + true 09:59:46 + case $1 in 09:59:46 + shift 09:59:46 + break 09:59:46 + case $python in 09:59:46 + local pkg_list= 09:59:46 + [[ -d /opt/pyenv ]] 09:59:46 + echo 'Setup pyenv:' 09:59:46 Setup pyenv: 09:59:46 + export PYENV_ROOT=/opt/pyenv 09:59:46 + PYENV_ROOT=/opt/pyenv 09:59:46 + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 + pyenv versions 09:59:46 system 09:59:46 3.8.20 09:59:46 3.9.20 09:59:46 3.10.15 09:59:46 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 09:59:46 + command -v pyenv 09:59:46 ++ pyenv init - --no-rehash 09:59:46 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 09:59:46 for i in ${!paths[@]}; do 09:59:46 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 09:59:46 fi; done; 09:59:46 echo "${paths[*]}"'\'')" 09:59:46 export PATH="/opt/pyenv/shims:${PATH}" 09:59:46 export PYENV_SHELL=bash 09:59:46 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 09:59:46 pyenv() { 09:59:46 local command 09:59:46 command="${1:-}" 09:59:46 if [ "$#" -gt 0 ]; then 09:59:46 shift 09:59:46 fi 09:59:46 09:59:46 case "$command" in 09:59:46 rehash|shell) 09:59:46 eval "$(pyenv "sh-$command" "$@")" 09:59:46 ;; 09:59:46 *) 09:59:46 command pyenv "$command" "$@" 09:59:46 ;; 09:59:46 esac 09:59:46 }' 09:59:46 +++ bash --norc -ec 'IFS=:; paths=($PATH); 09:59:46 for i in ${!paths[@]}; do 09:59:46 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 09:59:46 fi; done; 09:59:46 echo "${paths[*]}"' 09:59:46 ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:46 ++ export PYENV_SHELL=bash 09:59:46 ++ PYENV_SHELL=bash 09:59:46 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 09:59:46 +++ complete -F _pyenv pyenv 09:59:46 ++ lf-pyver python3 09:59:46 ++ local py_version_xy=python3 09:59:46 ++ local py_version_xyz= 09:59:46 ++ pyenv versions 09:59:46 ++ local command 09:59:46 ++ command=versions 09:59:46 ++ '[' 1 -gt 0 ']' 09:59:46 ++ shift 09:59:46 ++ case "$command" in 09:59:46 ++ command pyenv versions 09:59:46 ++ sed 's/^[ *]* //' 09:59:46 ++ awk '{ print $1 }' 09:59:46 ++ grep -E '^[0-9.]*[0-9]$' 09:59:46 ++ [[ ! -s /tmp/.pyenv_versions ]] 09:59:46 +++ grep '^3' /tmp/.pyenv_versions 09:59:46 +++ sort -V 09:59:46 +++ tail -n 1 09:59:46 ++ py_version_xyz=3.11.10 09:59:46 ++ [[ -z 3.11.10 ]] 09:59:46 ++ echo 3.11.10 09:59:46 ++ return 0 09:59:46 + pyenv local 3.11.10 09:59:46 + local command 09:59:46 + command=local 09:59:46 + '[' 2 -gt 0 ']' 09:59:46 + shift 09:59:46 + case "$command" in 09:59:46 + command pyenv local 3.11.10 09:59:46 + for arg in "$@" 09:59:46 + case $arg in 09:59:46 + pkg_list+='tox ' 09:59:46 + for arg in "$@" 09:59:46 + case $arg in 09:59:46 + pkg_list+='virtualenv ' 09:59:46 + for arg in "$@" 09:59:46 + case $arg in 09:59:46 + pkg_list+='urllib3~=1.26.15 ' 09:59:46 + [[ -f /tmp/.toxenv ]] 09:59:46 ++ cat /tmp/.toxenv 09:59:46 + lf_venv=/tmp/venv-R0aW 09:59:46 + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-R0aW from' file:/tmp/.toxenv 09:59:46 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-R0aW from file:/tmp/.toxenv 09:59:46 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 09:59:46 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 09:59:46 + local 'pip_opts=--upgrade --quiet' 09:59:46 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 09:59:46 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 09:59:46 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 09:59:46 + [[ -n '' ]] 09:59:46 + [[ -n '' ]] 09:59:46 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 09:59:46 lf-activate-venv(): INFO: Attempting to install with network-safe options... 09:59:46 + /tmp/venv-R0aW/bin/python3 -m pip install --upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org pip 'setuptools<66' virtualenv 09:59:48 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 09:59:48 lf-activate-venv(): INFO: Base packages installed successfully 09:59:48 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 09:59:48 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 09:59:48 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 09:59:48 + /tmp/venv-R0aW/bin/python3 -m pip install --upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 09:59:49 + type python3 09:59:49 + true 09:59:49 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-R0aW/bin to PATH' 09:59:49 lf-activate-venv(): INFO: Adding /tmp/venv-R0aW/bin to PATH 09:59:49 + PATH=/tmp/venv-R0aW/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:49 + return 0 09:59:49 + [[ -d /opt/pyenv ]] 09:59:49 + echo '---> Setting up pyenv' 09:59:49 ---> Setting up pyenv 09:59:49 + export PYENV_ROOT=/opt/pyenv 09:59:49 + PYENV_ROOT=/opt/pyenv 09:59:49 + export PATH=/opt/pyenv/bin:/tmp/venv-R0aW/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:49 + PATH=/opt/pyenv/bin:/tmp/venv-R0aW/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 09:59:49 ++ pwd 09:59:49 + PYTHONPATH=/w/workspace/transportpce-tox-verify-transportpce-master 09:59:49 + export PYTHONPATH 09:59:49 + export TOX_TESTENV_PASSENV=PYTHONPATH 09:59:49 + TOX_TESTENV_PASSENV=PYTHONPATH 09:59:49 + tox --version 09:59:49 4.55.1 from /tmp/venv-R0aW/lib/python3.11/site-packages/tox/__init__.py 09:59:49 + PARALLEL=True 09:59:49 + TOX_OPTIONS_LIST= 09:59:49 + [[ -n '' ]] 09:59:49 + case ${PARALLEL,,} in 09:59:49 + TOX_OPTIONS_LIST=' --parallel auto --parallel-live' 09:59:49 + tox --parallel auto --parallel-live 09:59:49 + tee -a /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tox.log 09:59:51 buildcontroller: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 09:59:51 docs-linkcheck: install_deps> python -I -m pip install -r docs/requirements.txt 09:59:51 docs: install_deps> python -I -m pip install -r docs/requirements.txt 09:59:51 checkbashisms: freeze> python -m pip freeze --all 09:59:52 checkbashisms: pip==26.1.2,setuptools==82.0.1 09:59:52 checkbashisms: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 09:59:52 checkbashisms: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts || sudo yum install -y https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/x86_64/os/Packages/d/devscripts-checkbashisms-2.19.6-2.fc31.x86_64.rpm || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)' 09:59:52 checkbashisms: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find . -not -path '*/\.*' -name '*.sh' -exec checkbashisms -f '{}' + 09:59:53 checkbashisms: OK ✔ in 3.27 seconds 09:59:53 pre-commit: install_deps> python -I -m pip install pre-commit 09:59:56 pre-commit: freeze> python -m pip freeze --all 09:59:56 pre-commit: cfgv==3.5.0,distlib==0.4.3,filelock==3.29.4,identify==2.6.19,nodeenv==1.10.0,pip==26.1.2,platformdirs==4.10.0,pre_commit==4.6.0,python-discovery==1.4.2,PyYAML==6.0.3,setuptools==82.0.1,virtualenv==21.5.1 09:59:56 pre-commit: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 09:59:56 pre-commit: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sh -c 'which cpan || sudo yum install -y perl-CPAN || (echo "cpan command not found - please install it (e.g. sudo apt-get install perl-modules | yum install perl-CPAN )" >&2 && exit 1)' 09:59:56 /usr/bin/cpan 09:59:56 pre-commit: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run --all-files --show-diff-on-failure 09:59:56 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 09:59:56 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. 09:59:57 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. 09:59:57 [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. 09:59:57 [INFO] Initializing environment for https://github.com/hhatto/autopep8. 09:59:58 [INFO] Initializing environment for https://github.com/perltidy/perltidy. 09:59:59 [INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit. 09:59:59 buildcontroller: freeze> python -m pip freeze --all 10:00:00 buildcontroller: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:00:00 buildcontroller: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_controller.sh 10:00:00 + update-java-alternatives -l 10:00:00 java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64 10:00:00 java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64 10:00:00 java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 10:00:00 + sudo update-java-alternatives -s java-1.21.0-openjdk-amd64 10:00:00 update-alternatives: error: no alternatives for jaotc 10:00:00 update-alternatives: error: no alternatives for rmic 10:00:00 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier. 10:00:00 + + sed -n ;s/.* version "\(.*\)\.\(.*\)\..*".*$/\1/p; 10:00:00 java -version 10:00:00 + JAVA_VER=21 10:00:00 + echo 21 10:00:00 21 10:00:00 + sed -n ;s/javac \(.*\)\.\(.*\)\..*.*$/\1/p; 10:00:00 + javac -version 10:00:00 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier@4.0.0-alpha.8. 10:00:00 + JAVAC_VER=21 10:00:00 + echo 21 10:00:00 + [ 21 -ge 21 ] 10:00:00 + [ 21 -ge 21 ] 10:00:00 + echo ok, java is 21 or newer 10:00:00 + wget -nv https://dlcdn.apache.org/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz -P /tmp 10:00:00 21 10:00:00 ok, java is 21 or newer 10:00:01 [INFO] Initializing environment for https://github.com/adrienverge/yamllint. 10:00:01 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 10:00:01 [INFO] Once installed this environment will be reused. 10:00:01 [INFO] This may take a few minutes... 10:00:04 2026-06-17 10:00:04 URL:https://dlcdn.apache.org/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz [9278065/9278065] -> "/tmp/apache-maven-3.9.16-bin.tar.gz" [1] 10:00:04 + sudo mkdir -p /opt 10:00:04 + sudo tar xf /tmp/apache-maven-3.9.16-bin.tar.gz -C /opt 10:00:04 + sudo ln -s /opt/apache-maven-3.9.16 /opt/maven 10:00:04 + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn 10:00:04 + mvn --version 10:00:05 Apache Maven 3.9.16 (2bdd9fddda4b155ebf8000e807eb73fd829a51d5) 10:00:05 Maven home: /opt/maven 10:00:05 Java version: 21.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 10:00:05 Default locale: en, platform encoding: UTF-8 10:00:05 OS name: "linux", version: "5.15.0-174-generic", arch: "amd64", family: "unix" 10:00:06 NOTE: Picked up JDK_JAVA_OPTIONS: 10:00:06 --add-opens=java.base/java.io=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.lang=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.net=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.nio=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.nio.file=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.util=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.util.jar=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.util.stream=ALL-UNNAMED 10:00:06 --add-opens=java.base/java.util.zip=ALL-UNNAMED 10:00:06 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 10:00:06 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 10:00:06 -Xlog:disable 10:00:07 [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. 10:00:07 [INFO] Once installed this environment will be reused. 10:00:07 [INFO] This may take a few minutes... 10:00:13 [INFO] Installing environment for https://github.com/hhatto/autopep8. 10:00:13 [INFO] Once installed this environment will be reused. 10:00:13 [INFO] This may take a few minutes... 10:00:19 [INFO] Installing environment for https://github.com/perltidy/perltidy. 10:00:19 [INFO] Once installed this environment will be reused. 10:00:19 [INFO] This may take a few minutes... 10:00:19 docs: freeze> python -m pip freeze --all 10:00:19 docs: alabaster==1.0.0,attrs==26.1.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.5.20,charset-normalizer==3.4.7,contourpy==1.3.3,cycler==0.12.1,docutils==0.21.2,fonttools==4.63.0,funcparserlib==2.0.0a0,future==1.0.0,idna==3.18,imagesize==2.0.0,Jinja2==3.1.6,jsonschema==3.2.0,kiwisolver==1.5.0,lfdocs_conf==0.10.0,MarkupSafe==3.0.3,matplotlib==3.11.0,numpy==2.4.6,nwdiag==3.0.0,packaging==26.2,pillow==12.2.0,pip==26.1.2,Pygments==2.20.0,pyparsing==3.3.2,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.3,requests==2.34.2,requests-file==1.5.1,roman-numerals==4.1.0,roman-numerals-py==4.1.0,seqdiag==3.0.0,setuptools==82.0.1,six==1.17.0,snowballstemmer==3.1.1,Sphinx==8.2.3,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.5,sphinx-tabs==3.5.0,sphinx_rtd_theme==3.1.0,sphinxcontrib-applehelp==2.0.0,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==2.0.0,sphinxcontrib-htmlhelp==2.1.0,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.31,sphinxcontrib-qthelp==2.0.0,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==2.0.0,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.7.0,webcolors==25.10.0 10:00:19 docs: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sphinx-build -q -W --keep-going -b html -n -d /w/workspace/transportpce-tox-verify-transportpce-master/.tox/docs/tmp/doctrees ../docs/ /w/workspace/transportpce-tox-verify-transportpce-master/docs/_build/html 10:00:19 docs-linkcheck: freeze> python -m pip freeze --all 10:00:20 docs-linkcheck: alabaster==1.0.0,attrs==26.1.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.5.20,charset-normalizer==3.4.7,contourpy==1.3.3,cycler==0.12.1,docutils==0.21.2,fonttools==4.63.0,funcparserlib==2.0.0a0,future==1.0.0,idna==3.18,imagesize==2.0.0,Jinja2==3.1.6,jsonschema==3.2.0,kiwisolver==1.5.0,lfdocs_conf==0.10.0,MarkupSafe==3.0.3,matplotlib==3.11.0,numpy==2.4.6,nwdiag==3.0.0,packaging==26.2,pillow==12.2.0,pip==26.1.2,Pygments==2.20.0,pyparsing==3.3.2,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.3,requests==2.34.2,requests-file==1.5.1,roman-numerals==4.1.0,roman-numerals-py==4.1.0,seqdiag==3.0.0,setuptools==82.0.1,six==1.17.0,snowballstemmer==3.1.1,Sphinx==8.2.3,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.5,sphinx-tabs==3.5.0,sphinx_rtd_theme==3.1.0,sphinxcontrib-applehelp==2.0.0,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==2.0.0,sphinxcontrib-htmlhelp==2.1.0,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.31,sphinxcontrib-qthelp==2.0.0,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==2.0.0,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.7.0,webcolors==25.10.0 10:00:20 docs-linkcheck: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sphinx-build -q -b linkcheck -d /w/workspace/transportpce-tox-verify-transportpce-master/.tox/docs-linkcheck/tmp/doctrees ../docs/ /w/workspace/transportpce-tox-verify-transportpce-master/docs/_build/linkcheck 10:00:22 docs: OK ✔ in 32.31 seconds 10:00:22 pylint: install_deps> python -I -m pip install 'pylint>=2.6.0' 10:00:25 docs-linkcheck: OK ✔ in 34.97 seconds 10:00:25 pylint: freeze> python -m pip freeze --all 10:00:25 pylint: astroid==4.0.4,dill==0.4.1,isort==8.0.1,mccabe==0.7.0,pip==26.1.2,platformdirs==4.10.0,pylint==4.0.6,setuptools==82.0.1,tomlkit==0.15.0 10:00:25 pylint: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find transportpce_tests/ -name '*.py' -exec pylint --fail-under=10 --max-line-length=120 --disable=missing-docstring,import-error --disable=fixme --disable=duplicate-code '--module-rgx=([a-z0-9_]+$)|([0-9.]{1,30}$)' '--method-rgx=(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$' '--variable-rgx=[a-zA-Z_][a-zA-Z0-9_]{1,30}$' '{}' + 10:00:30 [INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier. 10:00:30 [INFO] Once installed this environment will be reused. 10:00:30 [INFO] This may take a few minutes... 10:00:37 [INFO] Installing environment for https://github.com/adrienverge/yamllint. 10:00:37 [INFO] Once installed this environment will be reused. 10:00:37 [INFO] This may take a few minutes... 10:00:43 trim trailing whitespace.................................................Passed 10:00:43 fix end of files.........................................................Passed 10:00:43 check for added large files..............................................Passed 10:00:43 check for merge conflicts................................................Passed 10:00:44 check for case conflicts.................................................Passed 10:00:44 check json...............................................................Passed 10:00:44 mixed line ending........................................................Passed 10:00:45 Tabs remover.............................................................Passed 10:00:45 autopep8.................................................................Passed 10:00:48 perltidy.................................................................Passed 10:00:49 ShellCheck v0.11.0....................................................... 10:00:51 ------------------------------------ 10:00:51 Your code has been rated at 10.00/10 10:00:51 10:00:56 Passed 10:00:56 prettier.................................................................Passed 10:00:58 yamllint.................................................................Passed 10:00:58 pylint: OK ✔ in 31.04 seconds 10:00:58 pre-commit: commands[3] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run gitlint-ci --hook-stage manual 10:00:58 [INFO] Installing environment for https://github.com/jorisroovers/gitlint. 10:00:58 [INFO] Once installed this environment will be reused. 10:00:58 [INFO] This may take a few minutes... 10:01:07 gitlint..................................................................Passed 10:01:56 pre-commit: OK ✔ in 1 minute 14.68 seconds 10:01:56 buildcontroller: OK ✔ in 2 minutes 5.16 seconds 10:01:56 build_karaf_tests200: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:01:56 build_karaf_tests71: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:01:56 build_karaf_tests121: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:01:56 build_karaf_tests221: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:02:04 build_karaf_tests200: freeze> python -m pip freeze --all 10:02:04 build_karaf_tests221: freeze> python -m pip freeze --all 10:02:04 build_karaf_tests121: freeze> python -m pip freeze --all 10:02:04 build_karaf_tests71: freeze> python -m pip freeze --all 10:02:04 build_karaf_tests200: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:02:04 build_karaf_tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 10:02:04 build karaf in karafoc200 with ./karafoc200.env 10:02:04 build_karaf_tests221: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:02:04 build_karaf_tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 10:02:04 build_karaf_tests121: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:02:04 build_karaf_tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 10:02:04 NOTE: Picked up JDK_JAVA_OPTIONS: 10:02:04 --add-opens=java.base/java.io=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.net=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.file=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.jar=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.stream=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.zip=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 10:02:04 -Xlog:disable 10:02:04 build karaf in karaf221 with ./karaf221.env 10:02:04 build karaf in karaf121 with ./karaf121.env 10:02:04 build_karaf_tests71: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:02:04 build_karaf_tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 10:02:04 build karaf in karaf71 with ./karaf71.env 10:02:04 NOTE: Picked up JDK_JAVA_OPTIONS: 10:02:04 --add-opens=java.base/java.io=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.net=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.file=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.jar=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.stream=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.zip=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 10:02:04 -Xlog:disable 10:02:04 NOTE: Picked up JDK_JAVA_OPTIONS: 10:02:04 --add-opens=java.base/java.io=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.net=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.file=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.jar=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.stream=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.zip=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 10:02:04 -Xlog:disable 10:02:04 NOTE: Picked up JDK_JAVA_OPTIONS: 10:02:04 --add-opens=java.base/java.io=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.net=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.nio.file=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.jar=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.stream=ALL-UNNAMED 10:02:04 --add-opens=java.base/java.util.zip=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 10:02:04 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 10:02:04 -Xlog:disable 10:02:58 build_karaf_tests200: OK ✔ in 1 minute 2.9 seconds 10:02:58 buildlighty: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:03:02 build_karaf_tests121: OK ✔ in 1 minute 6.44 seconds 10:03:02 sims: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:03:04 build_karaf_tests71: OK ✔ in 1 minute 8.5 seconds 10:03:04 build_karaf_tests221: OK ✔ in 1 minute 8.64 seconds 10:03:04 testsPCE: install_deps> python -I -m pip install gnpy4tpce==2.4.7 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:03:12 buildlighty: freeze> python -m pip freeze --all 10:03:13 sims: freeze> python -m pip freeze --all 10:03:13 buildlighty: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:03:13 buildlighty: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh 10:03:13 NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED 10:03:13 sims: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:03:13 sims: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_lightynode.sh 10:03:13 Using lighynode version 22.1.0.7 10:03:13 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 10:03:17 sims: OK ✔ in 15.34 seconds 10:03:17 tests71: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:03:23 tests71: freeze> python -m pip freeze --all 10:03:23 tests71: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:03:23 tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 7.1 10:03:23 using environment variables from ./karaf71.env 10:03:23 pytest -q transportpce_tests/7.1/test01_portmapping.py 10:04:08 .buildlighty: OK ✔ in 51.44 seconds 10:04:08 testsPCE: freeze> python -m pip freeze --all 10:04:09 testsPCE: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,click==8.4.1,contourpy==1.3.3,cryptography==3.3.2,cycler==0.12.1,dict2xml==1.7.8,Flask==2.1.3,Flask-Injector==0.14.0,fonttools==4.63.0,gnpy4tpce==2.4.7,idna==3.18,iniconfig==2.3.0,injector==0.24.0,invoke==3.0.3,itsdangerous==2.2.0,Jinja2==3.1.6,kiwisolver==1.5.0,lxml==6.1.1,MarkupSafe==3.0.3,matplotlib==3.11.0,netconf-client==3.6.0,networkx==2.8.8,numpy==1.26.4,packaging==26.2,pandas==1.5.3,paramiko==5.0.0,pbr==5.11.1,pillow==12.2.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pyparsing==3.3.2,pytest==9.1.0,python-dateutil==2.9.0.post0,pytz==2026.2,requests==2.34.2,scipy==1.17.1,setuptools==50.3.2,six==1.17.0,urllib3==2.7.0,Werkzeug==2.0.3,xlrd==1.2.0 10:04:09 testsPCE: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce 10:04:09 pytest -q transportpce_tests/pce/test01_pce.py 10:04:09 ........... [100%] 10:04:21 12 passed in 57.59s 10:04:21 pytest -q transportpce_tests/7.1/test02_otn_renderer.py 10:04:59 ...................................................... [100%] 10:06:10 20 passed in 121.67s (0:02:01) 10:06:11 pytest -q transportpce_tests/pce/test02_pce_400G.py 10:06:12 ................................... [100%] 10:06:58 12 passed in 47.63s 10:06:58 pytest -q transportpce_tests/pce/test03_gnpy.py 10:07:00 ..... [100%] 10:07:10 62 passed in 169.01s (0:02:49) 10:07:10 pytest -q transportpce_tests/7.1/test03_renderer_or_modes.py 10:07:15 F...FFF. [100%] 10:07:31 =================================== FAILURES =================================== 10:07:31 _________________ TestTransportGnpy.test_00_load_port_mapping __________________ 10:07:31 10:07:31 self = 10:07:31 10:07:31 def test_00_load_port_mapping(self): 10:07:31 response = test_utils.post_portmapping(self.port_mapping_data) 10:07:31 > self.assertIn(response['status_code'], (requests.codes.created, requests.codes.no_content)) 10:07:31 E AssertionError: 404 not found in (201, 204) 10:07:31 10:07:31 transportpce_tests/pce/test03_gnpy.py:119: AssertionError 10:07:31 ---------------------------- Captured stdout setup ----------------------------- 10:07:31 sample files content loaded 10:07:31 starting GNPy REST server... 10:07:31 starting OpenDaylight... 10:07:31 starting KARAF (karaf) TransportPCE build... 10:07:31 Searching for patterns in karaf.log... Pattern found! OpenDaylight started ! 10:07:31 __________ TestTransportGnpy.test_04_path_computation_FeasibleWithPCE __________ 10:07:31 10:07:31 self = 10:07:31 10:07:31 def test_04_path_computation_FeasibleWithPCE(self): 10:07:31 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 10:07:31 'path-computation-request', 10:07:31 self.path_computation_input_data) 10:07:31 self.assertEqual(response['status_code'], requests.codes.ok) 10:07:31 > self.assertEqual(response['output']['configuration-response-common']['response-code'], '200') 10:07:31 E AssertionError: '500' != '200' 10:07:31 E - 500 10:07:31 E ? ^ 10:07:31 E + 200 10:07:31 E ? ^ 10:07:31 10:07:31 transportpce_tests/pce/test03_gnpy.py:144: AssertionError 10:07:31 ___ TestTransportGnpy.test_05_path_computation_FoundByPCE_NotFeasibleByGnpy ____ 10:07:31 10:07:31 self = 10:07:31 10:07:31 def test_05_path_computation_FoundByPCE_NotFeasibleByGnpy(self): 10:07:31 self.path_computation_input_data["service-name"] = "service-2" 10:07:31 self.path_computation_input_data["service-handler-header"]["request-id"] = "request-2" 10:07:31 self.path_computation_input_data["hard-constraints"] =\ 10:07:31 {"include": {"node-id": ["OpenROADM-2", "OpenROADM-3", "OpenROADM-4"]}} 10:07:31 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 10:07:31 'path-computation-request', 10:07:31 self.path_computation_input_data) 10:07:31 self.assertEqual(response['status_code'], requests.codes.ok) 10:07:31 self.assertEqual(response['output']['configuration-response-common'][ 10:07:31 'response-code'], '500') 10:07:31 self.assertEqual(response['output']['configuration-response-common'][ 10:07:31 'response-message'], 10:07:31 'No path available by PCE and GNPy ') 10:07:31 self.assertIn('A-to-Z', 10:07:31 > [response['output']['gnpy-response'][0]['path-dir'], 10:07:31 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:07:31 response['output']['gnpy-response'][1]['path-dir']]) 10:07:31 E KeyError: 'gnpy-response' 10:07:31 10:07:31 transportpce_tests/pce/test03_gnpy.py:174: KeyError 10:07:31 ______ TestTransportGnpy.test_06_path_computation_FoundByPCE_FoundByGNPy _______ 10:07:31 10:07:31 self = 10:07:31 10:07:31 def test_06_path_computation_FoundByPCE_FoundByGNPy(self): 10:07:31 self.path_computation_input_data["service-name"] = "service-3" 10:07:31 self.path_computation_input_data["service-handler-header"]["request-id"] = "request-3" 10:07:31 self.path_computation_input_data["service-z-end"]["node-id"] = "XPONDER-4" 10:07:31 self.path_computation_input_data["hard-constraints"] =\ 10:07:31 {"include": {"node-id": ["OpenROADM-2", "OpenROADM-3"]}} 10:07:31 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 10:07:31 'path-computation-request', 10:07:31 self.path_computation_input_data) 10:07:31 self.assertEqual(response['status_code'], requests.codes.ok) 10:07:31 > self.assertEqual(response['output']['configuration-response-common'][ 10:07:31 'response-code'], '200') 10:07:31 E AssertionError: '500' != '200' 10:07:31 E - 500 10:07:31 E ? ^ 10:07:31 E + 200 10:07:31 E ? ^ 10:07:31 10:07:31 transportpce_tests/pce/test03_gnpy.py:196: AssertionError 10:07:31 =========================== short test summary info ============================ 10:07:31 FAILED transportpce_tests/pce/test03_gnpy.py::TestTransportGnpy::test_00_load_port_mapping 10:07:31 FAILED transportpce_tests/pce/test03_gnpy.py::TestTransportGnpy::test_04_path_computation_FeasibleWithPCE 10:07:31 FAILED transportpce_tests/pce/test03_gnpy.py::TestTransportGnpy::test_05_path_computation_FoundByPCE_NotFeasibleByGnpy 10:07:31 FAILED transportpce_tests/pce/test03_gnpy.py::TestTransportGnpy::test_06_path_computation_FoundByPCE_FoundByGNPy 10:07:31 4 failed, 4 passed in 32.81s 10:07:32 testsPCE: exit 1 (202.96 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce pid=5934 10:07:32 testsPCE: FAIL ✖ in 4 minutes 28.27 seconds 10:07:32 tests_tapi: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:07:32 tests200: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:07:32 tests121: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:07:41 tests_tapi: freeze> python -m pip freeze --all 10:07:41 tests121: freeze> python -m pip freeze --all 10:07:41 tests200: freeze> python -m pip freeze --all 10:07:41 tests_tapi: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:07:41 tests_tapi: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh tapi 10:07:41 using environment variables from ./karaf221.env 10:07:41 pytest -q transportpce_tests/tapi/test01_abstracted_topology.py 10:07:41 tests121: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:07:41 tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 10:07:41 using environment variables from ./karaf121.env 10:07:41 pytest -q transportpce_tests/1.2.1/test01_portmapping.py 10:07:41 tests200: bcrypt==5.0.0,certifi==2026.5.20,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:07:41 tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh oc200 10:07:41 using environment variables from ./karafoc200.env 10:07:41 pytest -q transportpce_tests/oc200/test01_portmapping.py 10:07:57 ........................................... [100%] 10:09:14 10 passed in 92.62s (0:01:32) 10:09:14 pytest -q transportpce_tests/oc200/test02_topology.py 10:09:15 ............... [100%] 10:09:48 48 passed in 157.18s (0:02:37) 10:09:48 pytest -q transportpce_tests/7.1/test04_renderer_regen_mode.py 10:09:48 .............................................. [100%] 10:10:32 14 passed in 77.28s (0:01:17) 10:10:32 pytest -q transportpce_tests/oc200/test03_renderer.py 10:10:33 ........................................ [100%] 10:11:19 22 passed in 90.93s (0:01:30) 10:11:19 ... [100%] 10:11:23 16 passed in 51.33s 10:11:33 ............F.FF.FFFFFFFFFFFFFFFFF [100%] 10:12:24 =================================== FAILURES =================================== 10:12:24 ___________ TestTransportPCEPortmapping.test_02_rdm_device_connected ___________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_02_rdm_device_connected(self): 10:12:24 > response = test_utils.check_device_connection("ROADMA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:54: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:409: in check_device_connection 10:12:24 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_02_rdm_device_connected 10:12:24 ___________ TestTransportPCEPortmapping.test_03_rdm_portmapping_info ___________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_03_rdm_portmapping_info(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:60: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_03_rdm_portmapping_info 10:12:24 ______ TestTransportPCEPortmapping.test_04_rdm_portmapping_DEG1_TTP_TXRX _______ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_04_rdm_portmapping_DEG1_TTP_TXRX(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "DEG1-TTP-TXRX") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:73: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_04_rdm_portmapping_DEG1_TTP_TXRX 10:12:24 ______ TestTransportPCEPortmapping.test_05_rdm_portmapping_SRG1_PP7_TXRX _______ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_05_rdm_portmapping_SRG1_PP7_TXRX(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG1-PP7-TXRX") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:82: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_05_rdm_portmapping_SRG1_PP7_TXRX 10:12:24 ______ TestTransportPCEPortmapping.test_06_rdm_portmapping_SRG3_PP1_TXRX _______ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_06_rdm_portmapping_SRG3_PP1_TXRX(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG3-PP1-TXRX") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:91: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_06_rdm_portmapping_SRG3_PP1_TXRX 10:12:24 __________ TestTransportPCEPortmapping.test_07_xpdr_device_connection __________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'PUT' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 10:12:24 body = '{"node": [{"node-id": "XPDRA01", "netconf-node-topology:netconf-node": {"netconf-node-topology:host": "127.0.0.1", "n...ff-millis": 1800000, "netconf-node-topology:backoff-multiplier": 1.5, "netconf-node-topology:keepalive-delay": 120}}]}' 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '709', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'PUT' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_07_xpdr_device_connection(self): 10:12:24 > response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:100: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:381: in mount_device 10:12:24 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:125: in put_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_07_xpdr_device_connection 10:12:24 __________ TestTransportPCEPortmapping.test_08_xpdr_device_connected ___________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_08_xpdr_device_connected(self): 10:12:24 > response = test_utils.check_device_connection("XPDRA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:104: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:409: in check_device_connection 10:12:24 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_08_xpdr_device_connected 10:12:24 __________ TestTransportPCEPortmapping.test_09_xpdr_portmapping_info ___________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_09_xpdr_portmapping_info(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:110: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_09_xpdr_portmapping_info 10:12:24 ________ TestTransportPCEPortmapping.test_10_xpdr_portmapping_NETWORK1 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_10_xpdr_portmapping_NETWORK1(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK1") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:123: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_10_xpdr_portmapping_NETWORK1 10:12:24 ________ TestTransportPCEPortmapping.test_11_xpdr_portmapping_NETWORK2 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_11_xpdr_portmapping_NETWORK2(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK2") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:135: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_11_xpdr_portmapping_NETWORK2 10:12:24 _________ TestTransportPCEPortmapping.test_12_xpdr_portmapping_CLIENT1 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_12_xpdr_portmapping_CLIENT1(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT1") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:147: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_12_xpdr_portmapping_CLIENT1 10:12:24 _________ TestTransportPCEPortmapping.test_13_xpdr_portmapping_CLIENT2 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_13_xpdr_portmapping_CLIENT2(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT2") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:159: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_13_xpdr_portmapping_CLIENT2 10:12:24 _________ TestTransportPCEPortmapping.test_14_xpdr_portmapping_CLIENT3 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_14_xpdr_portmapping_CLIENT3(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT3") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:170: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_14_xpdr_portmapping_CLIENT3 10:12:24 _________ TestTransportPCEPortmapping.test_15_xpdr_portmapping_CLIENT4 _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_15_xpdr_portmapping_CLIENT4(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT4") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:182: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_15_xpdr_portmapping_CLIENT4 10:12:24 ________ TestTransportPCEPortmapping.test_16_xpdr_device_disconnection _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'DELETE' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30 10:12:24 verify = True, cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'DELETE' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_16_xpdr_device_disconnection(self): 10:12:24 > response = test_utils.unmount_device("XPDRA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:193: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:398: in unmount_device 10:12:24 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:134: in delete_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30 10:12:24 verify = True, cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_16_xpdr_device_disconnection 10:12:24 _________ TestTransportPCEPortmapping.test_17_xpdr_device_disconnected _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_17_xpdr_device_disconnected(self): 10:12:24 > response = test_utils.check_device_connection("XPDRA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:197: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:409: in check_device_connection 10:12:24 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_17_xpdr_device_disconnected 10:12:24 ________ TestTransportPCEPortmapping.test_18_xpdr_device_not_connected _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_18_xpdr_device_not_connected(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:205: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_18_xpdr_device_not_connected 10:12:24 _________ TestTransportPCEPortmapping.test_19_rdm_device_disconnection _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'DELETE' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30 10:12:24 verify = True, cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'DELETE' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_19_rdm_device_disconnection(self): 10:12:24 > response = test_utils.unmount_device("ROADMA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:213: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:398: in unmount_device 10:12:24 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:134: in delete_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30 10:12:24 verify = True, cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01 (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_19_rdm_device_disconnection 10:12:24 _________ TestTransportPCEPortmapping.test_20_rdm_device_disconnected __________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_20_rdm_device_disconnected(self): 10:12:24 > response = test_utils.check_device_connection("ROADMA01") 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:217: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:409: in check_device_connection 10:12:24 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_20_rdm_device_disconnected 10:12:24 _________ TestTransportPCEPortmapping.test_21_rdm_device_not_connected _________ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 > sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 10:12:24 raise err 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 address = ('localhost', 8191), timeout = 30, source_address = None 10:12:24 socket_options = [(6, 1, 1)] 10:12:24 10:12:24 def create_connection( 10:12:24 address: tuple[str, int], 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 source_address: tuple[str, int] | None = None, 10:12:24 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 10:12:24 ) -> socket.socket: 10:12:24 """Connect to *address* and return the socket object. 10:12:24 10:12:24 Convenience function. Connect to *address* (a 2-tuple ``(host, 10:12:24 port)``) and return the socket object. Passing the optional 10:12:24 *timeout* parameter will set the timeout on the socket instance 10:12:24 before attempting to connect. If no *timeout* is supplied, the 10:12:24 global default timeout setting returned by :func:`socket.getdefaulttimeout` 10:12:24 is used. If *source_address* is set it must be a tuple of (host, port) 10:12:24 for the socket to bind as a source address before making the connection. 10:12:24 An host of '' or port 0 tells the OS to use the default. 10:12:24 """ 10:12:24 10:12:24 host, port = address 10:12:24 if host.startswith("["): 10:12:24 host = host.strip("[]") 10:12:24 err = None 10:12:24 10:12:24 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 10:12:24 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 10:12:24 # The original create_connection function always returns all records. 10:12:24 family = allowed_gai_family() 10:12:24 10:12:24 try: 10:12:24 host.encode("idna") 10:12:24 except UnicodeError: 10:12:24 raise LocationParseError(f"'{host}', label empty or too long") from None 10:12:24 10:12:24 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 10:12:24 af, socktype, proto, canonname, sa = res 10:12:24 sock = None 10:12:24 try: 10:12:24 sock = socket.socket(af, socktype, proto) 10:12:24 10:12:24 # If provided, set socket level options before connecting. 10:12:24 _set_socket_options(sock, socket_options) 10:12:24 10:12:24 if timeout is not _DEFAULT_TIMEOUT: 10:12:24 sock.settimeout(timeout) 10:12:24 if source_address: 10:12:24 sock.bind(source_address) 10:12:24 > sock.connect(sa) 10:12:24 E ConnectionRefusedError: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 10:12:24 body = None 10:12:24 headers = {'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 10:12:24 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 redirect = False, assert_same_host = False 10:12:24 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 10:12:24 release_conn = False, chunked = False, body_pos = None, preload_content = False 10:12:24 decode_content = False, response_kw = {} 10:12:24 10:12:24 def urlopen( # type: ignore[override] 10:12:24 self, 10:12:24 method: str, 10:12:24 url: str, 10:12:24 body: _TYPE_BODY | None = None, 10:12:24 headers: typing.Mapping[str, str] | None = None, 10:12:24 retries: Retry | bool | int | None = None, 10:12:24 redirect: bool = True, 10:12:24 assert_same_host: bool = True, 10:12:24 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 10:12:24 pool_timeout: int | None = None, 10:12:24 release_conn: bool | None = None, 10:12:24 chunked: bool = False, 10:12:24 body_pos: _TYPE_BODY_POSITION | None = None, 10:12:24 preload_content: bool = True, 10:12:24 decode_content: bool = True, 10:12:24 **response_kw: typing.Any, 10:12:24 ) -> BaseHTTPResponse: 10:12:24 """ 10:12:24 Get a connection from the pool and perform an HTTP request. This is the 10:12:24 lowest level call for making a request, so you'll need to specify all 10:12:24 the raw details. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 More commonly, it's appropriate to use a convenience method 10:12:24 such as :meth:`request`. 10:12:24 10:12:24 .. note:: 10:12:24 10:12:24 `release_conn` will only behave as expected if 10:12:24 `preload_content=False` because we want to make 10:12:24 `preload_content=False` the default behaviour someday soon without 10:12:24 breaking backwards compatibility. 10:12:24 10:12:24 :param method: 10:12:24 HTTP request method (such as GET, POST, PUT, etc.) 10:12:24 10:12:24 :param url: 10:12:24 The URL to perform the request on. 10:12:24 10:12:24 :param body: 10:12:24 Data to send in the request body, either :class:`str`, :class:`bytes`, 10:12:24 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 10:12:24 10:12:24 :param headers: 10:12:24 Dictionary of custom headers to send, such as User-Agent, 10:12:24 If-None-Match, etc. If None, pool headers are used. If provided, 10:12:24 these headers completely replace any pool-specific headers. 10:12:24 10:12:24 :param retries: 10:12:24 Configure the number of retries to allow before raising a 10:12:24 :class:`~urllib3.exceptions.MaxRetryError` exception. 10:12:24 10:12:24 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 10:12:24 :class:`~urllib3.util.retry.Retry` object for fine-grained control 10:12:24 over different types of retries. 10:12:24 Pass an integer number to retry connection errors that many times, 10:12:24 but no other types of errors. Pass zero to never retry. 10:12:24 10:12:24 If ``False``, then retries are disabled and any exception is raised 10:12:24 immediately. Also, instead of raising a MaxRetryError on redirects, 10:12:24 the redirect response will be returned. 10:12:24 10:12:24 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 10:12:24 10:12:24 :param redirect: 10:12:24 If True, automatically handle redirects (status codes 301, 302, 10:12:24 303, 307, 308). Each redirect counts as a retry. Disabling retries 10:12:24 will disable redirect, too. 10:12:24 10:12:24 :param assert_same_host: 10:12:24 If ``True``, will make sure that the host of the pool requests is 10:12:24 consistent else will raise HostChangedError. When ``False``, you can 10:12:24 use the pool on an HTTP proxy and request foreign hosts. 10:12:24 10:12:24 :param timeout: 10:12:24 If specified, overrides the default timeout for this one 10:12:24 request. It may be a float (in seconds) or an instance of 10:12:24 :class:`urllib3.util.Timeout`. 10:12:24 10:12:24 :param pool_timeout: 10:12:24 If set and the pool is set to block=True, then this method will 10:12:24 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 10:12:24 connection is available within the time period. 10:12:24 10:12:24 :param bool preload_content: 10:12:24 If True, the response's body will be preloaded into memory. 10:12:24 10:12:24 :param bool decode_content: 10:12:24 If True, will attempt to decode the body based on the 10:12:24 'content-encoding' header. 10:12:24 10:12:24 :param release_conn: 10:12:24 If False, then the urlopen call will not release the connection 10:12:24 back into the pool once a response is received (but will release if 10:12:24 you read the entire contents of the response such as when 10:12:24 `preload_content=True`). This is useful if you're not preloading 10:12:24 the response's content immediately. You will need to call 10:12:24 ``r.release_conn()`` on the response ``r`` to return the connection 10:12:24 back into the pool. If None, it takes the value of ``preload_content`` 10:12:24 which defaults to ``True``. 10:12:24 10:12:24 :param bool chunked: 10:12:24 If True, urllib3 will send the body using chunked transfer 10:12:24 encoding. Otherwise, urllib3 will send the body using the standard 10:12:24 content-length form. Defaults to False. 10:12:24 10:12:24 :param int body_pos: 10:12:24 Position to seek to in file-like body in the event of a retry or 10:12:24 redirect. Typically this won't need to be set because urllib3 will 10:12:24 auto-populate the value when needed. 10:12:24 """ 10:12:24 # Ensure that the URL we're connecting to is properly encoded 10:12:24 if url.startswith("/"): 10:12:24 # URLs starting with / are inherently schemeless. 10:12:24 url = to_str(_encode_target(url)) 10:12:24 destination_scheme = None 10:12:24 else: 10:12:24 parsed_url = parse_url(url) 10:12:24 destination_scheme = parsed_url.scheme 10:12:24 url = to_str(parsed_url.url) 10:12:24 10:12:24 if headers is None: 10:12:24 headers = self.headers 10:12:24 10:12:24 if not isinstance(retries, Retry): 10:12:24 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 10:12:24 10:12:24 if release_conn is None: 10:12:24 release_conn = preload_content 10:12:24 10:12:24 # Check host 10:12:24 if assert_same_host and not self.is_same_host(url): 10:12:24 raise HostChangedError(self, url, retries) 10:12:24 10:12:24 conn = None 10:12:24 10:12:24 # Track whether `conn` needs to be released before 10:12:24 # returning/raising/recursing. Update this variable if necessary, and 10:12:24 # leave `release_conn` constant throughout the function. That way, if 10:12:24 # the function recurses, the original value of `release_conn` will be 10:12:24 # passed down into the recursive call, and its value will be respected. 10:12:24 # 10:12:24 # See issue #651 [1] for details. 10:12:24 # 10:12:24 # [1] 10:12:24 release_this_conn = release_conn 10:12:24 10:12:24 http_tunnel_required = connection_requires_http_tunnel( 10:12:24 self.proxy, self.proxy_config, destination_scheme 10:12:24 ) 10:12:24 10:12:24 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 10:12:24 # have to copy the headers dict so we can safely change it without those 10:12:24 # changes being reflected in anyone else's copy. 10:12:24 if not http_tunnel_required: 10:12:24 headers = headers.copy() # type: ignore[attr-defined] 10:12:24 headers.update(self.proxy_headers) # type: ignore[union-attr] 10:12:24 10:12:24 # Must keep the exception bound to a separate variable or else Python 3 10:12:24 # complains about UnboundLocalError. 10:12:24 err = None 10:12:24 10:12:24 # Keep track of whether we cleanly exited the except block. This 10:12:24 # ensures we do proper cleanup in finally. 10:12:24 clean_exit = False 10:12:24 10:12:24 # Rewind body position, if needed. Record current position 10:12:24 # for future rewinds in the event of a redirect/retry. 10:12:24 body_pos = set_file_position(body, body_pos) 10:12:24 10:12:24 try: 10:12:24 # Request a connection from the queue. 10:12:24 timeout_obj = self._get_timeout(timeout) 10:12:24 conn = self._get_conn(timeout=pool_timeout) 10:12:24 10:12:24 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 10:12:24 10:12:24 # Is this a closed/new connection that requires CONNECT tunnelling? 10:12:24 if self.proxy is not None and http_tunnel_required and conn.is_closed: 10:12:24 try: 10:12:24 self._prepare_proxy(conn) 10:12:24 except (BaseSSLError, OSError, SocketTimeout) as e: 10:12:24 self._raise_timeout( 10:12:24 err=e, url=self.proxy.url, timeout_value=conn.timeout 10:12:24 ) 10:12:24 raise 10:12:24 10:12:24 # If we're going to release the connection in ``finally:``, then 10:12:24 # the response doesn't need to know about the connection. Otherwise 10:12:24 # it will also try to release it and we'll have a double-release 10:12:24 # mess. 10:12:24 response_conn = conn if not release_conn else None 10:12:24 10:12:24 # Make the request on the HTTPConnection object 10:12:24 > response = self._make_request( 10:12:24 conn, 10:12:24 method, 10:12:24 url, 10:12:24 timeout=timeout_obj, 10:12:24 body=body, 10:12:24 headers=headers, 10:12:24 chunked=chunked, 10:12:24 retries=retries, 10:12:24 response_conn=response_conn, 10:12:24 preload_content=preload_content, 10:12:24 decode_content=decode_content, 10:12:24 **response_kw, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 10:12:24 conn.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 10:12:24 self.endheaders() 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 10:12:24 self._send_output(message_body, encode_chunked=encode_chunked) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 10:12:24 self.send(msg) 10:12:24 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 10:12:24 self.connect() 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 10:12:24 self.sock = self._new_conn() 10:12:24 ^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 10:12:24 def _new_conn(self) -> socket.socket: 10:12:24 """Establish a socket connection and set nodelay settings on it. 10:12:24 10:12:24 :return: New socket connection. 10:12:24 """ 10:12:24 try: 10:12:24 sock = connection.create_connection( 10:12:24 (self._dns_host, self.port), 10:12:24 self.timeout, 10:12:24 source_address=self.source_address, 10:12:24 socket_options=self.socket_options, 10:12:24 ) 10:12:24 except socket.gaierror as e: 10:12:24 raise NameResolutionError(self.host, self, e) from e 10:12:24 except SocketTimeout as e: 10:12:24 raise ConnectTimeoutError( 10:12:24 self, 10:12:24 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 10:12:24 ) from e 10:12:24 10:12:24 except OSError as e: 10:12:24 > raise NewConnectionError( 10:12:24 self, f"Failed to establish a new connection: {e}" 10:12:24 ) from e 10:12:24 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 10:12:24 10:12:24 The above exception was the direct cause of the following exception: 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 > resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 10:12:24 retries = retries.increment( 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 10:12:24 method = 'GET' 10:12:24 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 10:12:24 response = None 10:12:24 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 10:12:24 _pool = 10:12:24 _stacktrace = 10:12:24 10:12:24 def increment( 10:12:24 self, 10:12:24 method: str | None = None, 10:12:24 url: str | None = None, 10:12:24 response: BaseHTTPResponse | None = None, 10:12:24 error: Exception | None = None, 10:12:24 _pool: ConnectionPool | None = None, 10:12:24 _stacktrace: TracebackType | None = None, 10:12:24 ) -> Self: 10:12:24 """Return a new Retry object with incremented retry counters. 10:12:24 10:12:24 :param response: A response object, or None, if the server did not 10:12:24 return a response. 10:12:24 :type response: :class:`~urllib3.response.BaseHTTPResponse` 10:12:24 :param Exception error: An error encountered during the request, or 10:12:24 None if the response was received successfully. 10:12:24 10:12:24 :return: A new ``Retry`` object. 10:12:24 """ 10:12:24 if self.total is False and error: 10:12:24 # Disabled, indicate to re-raise the error. 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 10:12:24 total = self.total 10:12:24 if total is not None: 10:12:24 total -= 1 10:12:24 10:12:24 connect = self.connect 10:12:24 read = self.read 10:12:24 redirect = self.redirect 10:12:24 status_count = self.status 10:12:24 other = self.other 10:12:24 cause = "unknown" 10:12:24 status = None 10:12:24 redirect_location = None 10:12:24 10:12:24 if error and self._is_connection_error(error): 10:12:24 # Connect retry? 10:12:24 if connect is False: 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif connect is not None: 10:12:24 connect -= 1 10:12:24 10:12:24 elif error and self._is_read_error(error): 10:12:24 # Read retry? 10:12:24 if read is False or method is None or not self._is_method_retryable(method): 10:12:24 raise reraise(type(error), error, _stacktrace) 10:12:24 elif read is not None: 10:12:24 read -= 1 10:12:24 10:12:24 elif error: 10:12:24 # Other retry? 10:12:24 if other is not None: 10:12:24 other -= 1 10:12:24 10:12:24 elif response and response.get_redirect_location(): 10:12:24 # Redirect retry? 10:12:24 if redirect is not None: 10:12:24 redirect -= 1 10:12:24 cause = "too many redirects" 10:12:24 response_redirect_location = response.get_redirect_location() 10:12:24 if response_redirect_location: 10:12:24 redirect_location = response_redirect_location 10:12:24 status = response.status 10:12:24 10:12:24 else: 10:12:24 # Incrementing because of a server error like a 500 in 10:12:24 # status_forcelist and the given method is in the allowed_methods 10:12:24 cause = ResponseError.GENERIC_ERROR 10:12:24 if response and response.status: 10:12:24 if status_count is not None: 10:12:24 status_count -= 1 10:12:24 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 10:12:24 status = response.status 10:12:24 10:12:24 history = self.history + ( 10:12:24 RequestHistory(method, url, error, status, redirect_location), 10:12:24 ) 10:12:24 10:12:24 new_retry = self.new( 10:12:24 total=total, 10:12:24 connect=connect, 10:12:24 read=read, 10:12:24 redirect=redirect, 10:12:24 status=status_count, 10:12:24 other=other, 10:12:24 history=history, 10:12:24 ) 10:12:24 10:12:24 if new_retry.is_exhausted(): 10:12:24 reason = error or ResponseError(cause) 10:12:24 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 10:12:24 10:12:24 During handling of the above exception, another exception occurred: 10:12:24 10:12:24 self = 10:12:24 10:12:24 def test_21_rdm_device_not_connected(self): 10:12:24 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 10:12:24 transportpce_tests/1.2.1/test01_portmapping.py:225: 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 10:12:24 response = get_request(target_url) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 transportpce_tests/common/test_utils.py:117: in get_request 10:12:24 return requests.request( 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 10:12:24 return session.request(method=method, url=url, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 10:12:24 resp = self.send(prep, **send_kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 10:12:24 r = adapter.send(request, **kwargs) 10:12:24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10:12:24 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10:12:24 10:12:24 self = 10:12:24 request = , stream = False, timeout = 30, verify = True 10:12:24 cert = None, proxies = OrderedDict() 10:12:24 10:12:24 def send( 10:12:24 self, 10:12:24 request: PreparedRequest, 10:12:24 stream: bool = False, 10:12:24 timeout: _t.TimeoutType = None, 10:12:24 verify: _t.VerifyType = True, 10:12:24 cert: _t.CertType = None, 10:12:24 proxies: dict[str, str] | None = None, 10:12:24 ) -> Response: 10:12:24 """Sends PreparedRequest object. Returns Response object. 10:12:24 10:12:24 :param request: The :class:`PreparedRequest ` being sent. 10:12:24 :param stream: (optional) Whether to stream the request content. 10:12:24 :param timeout: (optional) How long to wait for the server to send 10:12:24 data before giving up, as a float, or a :ref:`(connect timeout, 10:12:24 read timeout) ` tuple. 10:12:24 :type timeout: float or tuple or urllib3 Timeout object 10:12:24 :param verify: (optional) Either a boolean, in which case it controls whether 10:12:24 we verify the server's TLS certificate, or a string, in which case it 10:12:24 must be a path to a CA bundle to use 10:12:24 :param cert: (optional) Any user-provided SSL certificate to be trusted. 10:12:24 :param proxies: (optional) The proxies dictionary to apply to the request. 10:12:24 :rtype: requests.Response 10:12:24 """ 10:12:24 10:12:24 assert _is_prepared(request) 10:12:24 10:12:24 try: 10:12:24 conn = self.get_connection_with_tls_context( 10:12:24 request, verify, proxies=proxies, cert=cert 10:12:24 ) 10:12:24 except LocationValueError as e: 10:12:24 raise InvalidURL(e, request=request) 10:12:24 10:12:24 self.cert_verify(conn, request.url, verify, cert) 10:12:24 url = self.request_url(request, proxies) 10:12:24 self.add_headers( 10:12:24 request, 10:12:24 stream=stream, 10:12:24 timeout=timeout, 10:12:24 verify=verify, 10:12:24 cert=cert, 10:12:24 proxies=proxies, 10:12:24 ) 10:12:24 10:12:24 chunked = not (request.body is None or "Content-Length" in request.headers) 10:12:24 10:12:24 if isinstance(timeout, tuple): 10:12:24 try: 10:12:24 connect, read = timeout 10:12:24 resolved_timeout = TimeoutSauce(connect=connect, read=read) 10:12:24 except ValueError: 10:12:24 raise ValueError( 10:12:24 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 10:12:24 f"or a single float to set both timeouts to the same value." 10:12:24 ) 10:12:24 elif isinstance(timeout, TimeoutSauce): 10:12:24 resolved_timeout = timeout 10:12:24 else: 10:12:24 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 10:12:24 10:12:24 try: 10:12:24 resp = conn.urlopen( 10:12:24 method=request.method, 10:12:24 url=url, 10:12:24 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 10:12:24 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 10:12:24 redirect=False, 10:12:24 assert_same_host=False, 10:12:24 preload_content=False, 10:12:24 decode_content=False, 10:12:24 retries=self.max_retries, 10:12:24 timeout=resolved_timeout, 10:12:24 chunked=chunked, 10:12:24 ) 10:12:24 10:12:24 except (ProtocolError, OSError) as err: 10:12:24 raise ConnectionError(err, request=request) 10:12:24 10:12:24 except MaxRetryError as e: 10:12:24 if isinstance(e.reason, ConnectTimeoutError): 10:12:24 # TODO: Remove this in 3.0.0: see #2811 10:12:24 if not isinstance(e.reason, NewConnectionError): 10:12:24 raise ConnectTimeout(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, ResponseError): 10:12:24 raise RetryError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _ProxyError): 10:12:24 raise ProxyError(e, request=request) 10:12:24 10:12:24 if isinstance(e.reason, _SSLError): 10:12:24 # This branch is for urllib3 v1.22 and later. 10:12:24 raise SSLError(e, request=request) 10:12:24 10:12:24 > raise ConnectionError(e, request=request) 10:12:24 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8191): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused")) 10:12:24 10:12:24 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 10:12:24 ----------------------------- Captured stdout call ----------------------------- 10:12:24 execution of test_21_rdm_device_not_connected 10:12:24 --------------------------- Captured stdout teardown --------------------------- 10:12:24 all processes killed 10:12:24 ODL log file stored 10:12:24 =========================== short test summary info ============================ 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_02_rdm_device_connected 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_03_rdm_portmapping_info 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_04_rdm_portmapping_DEG1_TTP_TXRX 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_05_rdm_portmapping_SRG1_PP7_TXRX 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_06_rdm_portmapping_SRG3_PP1_TXRX 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_07_xpdr_device_connection 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_08_xpdr_device_connected 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_09_xpdr_portmapping_info 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_10_xpdr_portmapping_NETWORK1 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_11_xpdr_portmapping_NETWORK2 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_12_xpdr_portmapping_CLIENT1 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_13_xpdr_portmapping_CLIENT2 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_14_xpdr_portmapping_CLIENT3 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_15_xpdr_portmapping_CLIENT4 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_16_xpdr_device_disconnection 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_17_xpdr_device_disconnected 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_18_xpdr_device_not_connected 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_19_rdm_device_disconnection 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_20_rdm_device_disconnected 10:12:24 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_21_rdm_device_not_connected 10:12:24 20 failed, 1 passed in 282.35s (0:04:42) 10:12:24 tests71: OK ✔ in 8 minutes 2.61 seconds 10:12:24 tests200: OK ✔ in 3 minutes 51.95 seconds 10:12:24 tests121: exit 1 (282.66 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 pid=9706 10:13:09 . [100%] 10:13:13 51 passed in 331.49s (0:05:31) 10:13:13 pytest -q transportpce_tests/tapi/test02_full_topology.py 10:14:05 .................................... [100%] 10:21:43 36 passed in 509.71s (0:08:29) 10:21:43 pytest -q transportpce_tests/tapi/test03_tapi_device_change_notifications.py 10:22:31 ....................................................................... [100%] 10:27:03 71 passed in 320.06s (0:05:20) 10:27:03 pytest -q transportpce_tests/tapi/test04_topo_extension.py 10:27:57 ................... [100%] 10:29:29 19 passed in 145.09s (0:02:25) 10:29:29 pytest -q transportpce_tests/tapi/test05_pce_tapi.py 10:31:35 ...................... [100%] 10:40:11 22 passed in 642.18s (0:10:42) 10:40:11 tests121: FAIL ✖ in 4 minutes 52.26 seconds 10:40:11 tests_tapi: OK ✔ in 32 minutes 39.55 seconds 10:40:11 tests221: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 10:40:19 tests221: freeze> python -m pip freeze --all 10:40:19 tests221: bcrypt==5.0.0,certifi==2026.6.17,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 10:40:19 tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 10:40:19 using environment variables from ./karaf221.env 10:40:19 pytest -q transportpce_tests/2.2.1/test01_portmapping.py 10:40:56 ................................... [100%] 10:41:36 35 passed in 76.81s (0:01:16) 10:41:36 pytest -q transportpce_tests/2.2.1/test02_topo_portmapping.py 10:42:09 ...... [100%] 10:42:23 6 passed in 46.63s 10:42:23 pytest -q transportpce_tests/2.2.1/test03_topology.py 10:43:08 ............................................ [100%] 10:44:43 44 passed in 139.54s (0:02:19) 10:44:43 pytest -q transportpce_tests/2.2.1/test04_otn_topology.py 10:45:20 ............ [100%] 10:45:44 12 passed in 61.23s (0:01:01) 10:45:45 pytest -q transportpce_tests/2.2.1/test05_flex_grid.py 10:46:11 ................ [100%] 10:47:40 16 passed in 115.22s (0:01:55) 10:47:40 pytest -q transportpce_tests/2.2.1/test06_renderer_service_path_nominal.py 10:48:10 ............................... [100%] 10:51:17 31 passed in 216.42s (0:03:36) 10:51:17 pytest -q transportpce_tests/2.2.1/test07_otn_renderer.py 10:51:53 .......................... [100%] 10:52:49 26 passed in 91.83s (0:01:31) 10:52:49 pytest -q transportpce_tests/2.2.1/test08_otn_sh_renderer.py 10:53:26 ...................... [100%] 10:54:30 22 passed in 100.83s (0:01:40) 10:54:30 pytest -q transportpce_tests/2.2.1/test09_olm.py 10:55:12 ........................................ [100%] 10:57:34 40 passed in 183.61s (0:03:03) 10:57:34 pytest -q transportpce_tests/2.2.1/test11_otn_end2end.py 10:58:17 ........................................................................ [ 74%] 11:03:54 ......................... [100%] 11:08:46 97 passed in 672.55s (0:11:12) 11:08:47 pytest -q transportpce_tests/2.2.1/test12_end2end.py 11:09:33 ...................................................... [100%] 11:16:21 54 passed in 454.58s (0:07:34) 11:16:21 pytest -q transportpce_tests/2.2.1/test14_otn_switch_end2end.py 11:17:18 ........................................................................ [ 71%] 11:22:27 ............................. [100%] 11:24:36 101 passed in 494.85s (0:08:14) 11:24:37 pytest -q transportpce_tests/2.2.1/test15_otn_end2end_with_intermediate_switch.py 11:25:32 ........................................................................ [ 67%] 11:31:19 ................................... [100%] 11:34:40 107 passed in 602.92s (0:10:02) 11:34:40 pytest -q transportpce_tests/2.2.1/test16_freq_end2end.py 11:35:24 ............................................. [100%] 11:38:03 45 passed in 202.79s (0:03:22) 11:38:03 tests221: OK ✔ in 57 minutes 51.77 seconds 11:38:03 tests_hybrid: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 11:38:11 tests_hybrid: freeze> python -m pip freeze --all 11:38:12 tests_hybrid: bcrypt==5.0.0,certifi==2026.6.17,cffi==2.0.0,charset-normalizer==3.4.7,cryptography==49.0.0,dict2xml==1.7.8,idna==3.18,iniconfig==2.3.0,invoke==3.0.3,lxml==6.1.1,netconf-client==3.6.0,packaging==26.2,paramiko==5.0.0,pip==26.1.2,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.20.0,PyNaCl==1.6.2,pytest==9.1.0,requests==2.34.2,setuptools==82.0.1,urllib3==2.7.0 11:38:12 tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid 11:38:12 using environment variables from ./karaf221.env 11:38:12 pytest -q transportpce_tests/hybrid/test01_device_change_notifications.py 11:38:54 ................................................... [100%] 11:43:41 51 passed in 329.24s (0:05:29) 11:43:41 pytest -q transportpce_tests/hybrid/test02_B100G_end2end.py 11:44:25 ........................................................................ [ 66%] 11:48:46 ..................................... [100%] 11:50:52 109 passed in 430.31s (0:07:10) 11:50:52 pytest -q transportpce_tests/hybrid/test03_autonomous_reroute.py 11:51:41 ..................................................... [100%] 11:58:14 53 passed in 442.42s (0:07:22) 11:58:14 buildcontroller: OK (125.16=setup[10.15]+cmd[115.00] seconds) 11:58:14 sims: OK (15.34=setup[11.79]+cmd[3.55] seconds) 11:58:14 build_karaf_tests121: OK (66.44=setup[9.52]+cmd[56.92] seconds) 11:58:14 testsPCE: FAIL code 1 (268.27=setup[65.30]+cmd[202.96] seconds) 11:58:14 tests121: FAIL code 1 (292.26=setup[9.60]+cmd[282.66] seconds) 11:58:14 build_karaf_tests221: OK (68.64=setup[9.51]+cmd[59.13] seconds) 11:58:14 tests_tapi: OK (1959.55=setup[9.55]+cmd[1950.00] seconds) 11:58:14 tests221: OK (3471.77=setup[8.07]+cmd[3463.71] seconds) 11:58:14 build_karaf_tests71: OK (68.50=setup[9.53]+cmd[58.97] seconds) 11:58:14 tests71: OK (482.61=setup[6.67]+cmd[475.94] seconds) 11:58:14 build_karaf_tests200: OK (62.90=setup[9.45]+cmd[53.46] seconds) 11:58:14 tests200: OK (231.95=setup[9.66]+cmd[222.29] seconds) 11:58:14 tests_hybrid: OK (1211.56=setup[8.77]+cmd[1202.79] seconds) 11:58:14 buildlighty: OK (51.44=setup[15.15]+cmd[36.29] seconds) 11:58:14 docs: OK (32.31=setup[29.78]+cmd[2.52] seconds) 11:58:14 docs-linkcheck: OK (34.97=setup[30.20]+cmd[4.77] seconds) 11:58:14 checkbashisms: OK (3.27=setup[2.06]+cmd[0.00,0.04,1.17] seconds) 11:58:14 pre-commit: OK (74.68=setup[3.09]+cmd[0.02,0.01,62.18,9.38] seconds) 11:58:14 pylint: OK (31.04=setup[3.51]+cmd[27.54] seconds) 11:58:14 evaluation failed :( (7105.00 seconds) 11:58:14 + tox_status=1 11:58:14 + echo '---> Completed tox runs' 11:58:14 ---> Completed tox runs 11:58:14 + for i in .tox/*/log 11:58:14 ++ echo .tox/build_karaf_tests121/log 11:58:14 ++ awk -F/ '{print $2}' 11:58:14 + tox_env=build_karaf_tests121 11:58:14 + cp -r .tox/build_karaf_tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests121 11:58:14 + for i in .tox/*/log 11:58:14 ++ echo .tox/build_karaf_tests200/log 11:58:14 ++ awk -F/ '{print $2}' 11:58:14 + tox_env=build_karaf_tests200 11:58:14 + cp -r .tox/build_karaf_tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests200 11:58:14 + for i in .tox/*/log 11:58:14 ++ echo .tox/build_karaf_tests221/log 11:58:14 ++ awk -F/ '{print $2}' 11:58:14 + tox_env=build_karaf_tests221 11:58:14 + cp -r .tox/build_karaf_tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests221 11:58:14 + for i in .tox/*/log 11:58:14 ++ echo .tox/build_karaf_tests71/log 11:58:14 ++ awk -F/ '{print $2}' 11:58:14 + tox_env=build_karaf_tests71 11:58:14 + cp -r .tox/build_karaf_tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests71 11:58:14 + for i in .tox/*/log 11:58:14 ++ echo .tox/buildcontroller/log 11:58:14 ++ awk -F/ '{print $2}' 11:58:14 + tox_env=buildcontroller 11:58:14 + cp -r .tox/buildcontroller/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildcontroller 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/buildlighty/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=buildlighty 11:58:15 + cp -r .tox/buildlighty/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildlighty 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/checkbashisms/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=checkbashisms 11:58:15 + cp -r .tox/checkbashisms/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/checkbashisms 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/docs-linkcheck/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=docs-linkcheck 11:58:15 + cp -r .tox/docs-linkcheck/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs-linkcheck 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/docs/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=docs 11:58:15 + cp -r .tox/docs/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/pre-commit/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=pre-commit 11:58:15 + cp -r .tox/pre-commit/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pre-commit 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/pylint/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=pylint 11:58:15 + cp -r .tox/pylint/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pylint 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/sims/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=sims 11:58:15 + cp -r .tox/sims/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests121/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests121 11:58:15 + cp -r .tox/tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests121 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests200/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests200 11:58:15 + cp -r .tox/tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests200 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests221/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests221 11:58:15 + cp -r .tox/tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests221 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests71/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests71 11:58:15 + cp -r .tox/tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests71 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/testsPCE/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=testsPCE 11:58:15 + cp -r .tox/testsPCE/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/testsPCE 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests_hybrid/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests_hybrid 11:58:15 + cp -r .tox/tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_hybrid 11:58:15 + for i in .tox/*/log 11:58:15 ++ echo .tox/tests_tapi/log 11:58:15 ++ awk -F/ '{print $2}' 11:58:15 + tox_env=tests_tapi 11:58:15 + cp -r .tox/tests_tapi/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_tapi 11:58:15 + DOC_DIR=docs/_build/html 11:58:15 + [[ -d docs/_build/html ]] 11:58:15 + echo '---> Archiving generated docs' 11:58:15 ---> Archiving generated docs 11:58:15 + mv docs/_build/html /w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 11:58:15 + echo '---> tox-run.sh ends' 11:58:15 ---> tox-run.sh ends 11:58:15 + test 1 -eq 0 11:58:15 + exit 1 11:58:15 ++ '[' 1 = 1 ']' 11:58:15 ++ '[' -x /usr/bin/clear_console ']' 11:58:15 ++ /usr/bin/clear_console -q 11:58:15 Build step 'Execute shell' marked build as failure 11:58:15 $ ssh-agent -k 11:58:15 unset SSH_AUTH_SOCK; 11:58:15 unset SSH_AGENT_PID; 11:58:15 echo Agent pid 1571 killed; 11:58:15 [ssh-agent] Stopped. 11:58:15 [PostBuildScript] - [INFO] Executing post build scripts. 11:58:15 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins15273759998518539832.sh 11:58:15 ---> sysstat.sh 11:58:16 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins8776321366869526466.sh 11:58:16 ---> package-listing.sh 11:58:16 ++ facter osfamily 11:58:16 ++ tr '[:upper:]' '[:lower:]' 11:58:16 + OS_FAMILY=debian 11:58:16 + workspace=/w/workspace/transportpce-tox-verify-transportpce-master 11:58:16 + START_PACKAGES=/tmp/packages_start.txt 11:58:16 + END_PACKAGES=/tmp/packages_end.txt 11:58:16 + DIFF_PACKAGES=/tmp/packages_diff.txt 11:58:16 + PACKAGES=/tmp/packages_start.txt 11:58:16 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 11:58:16 + PACKAGES=/tmp/packages_end.txt 11:58:16 + case "${OS_FAMILY}" in 11:58:16 + grep '^ii' 11:58:16 + dpkg -l 11:58:16 + '[' -f /tmp/packages_start.txt ']' 11:58:16 + '[' -f /tmp/packages_end.txt ']' 11:58:16 + diff /tmp/packages_start.txt /tmp/packages_end.txt 11:58:16 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 11:58:16 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 11:58:16 + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 11:58:16 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins7404307488227608484.sh 11:58:16 ---> capture-instance-metadata.sh 11:58:16 Setup pyenv: 11:58:16 system 11:58:16 3.8.20 11:58:16 3.9.20 11:58:16 3.10.15 11:58:16 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 11:58:17 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-pAmy from file:/tmp/.os_lf_venv 11:58:17 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 11:58:17 lf-activate-venv(): INFO: Attempting to install with network-safe options... 11:58:19 lf-activate-venv(): INFO: Base packages installed successfully 11:58:19 lf-activate-venv(): INFO: Installing additional packages: lftools 11:58:33 lf-activate-venv(): INFO: Adding /tmp/venv-pAmy/bin to PATH 11:58:33 INFO: Running in OpenStack, capturing instance metadata 11:58:33 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins7487727081635775813.sh 11:58:33 provisioning config files... 11:58:33 Could not find credentials [logs] for transportpce-tox-verify-transportpce-master #5703 11:58:33 copy managed file [jenkins-log-archives-settings] to file:/w/workspace/transportpce-tox-verify-transportpce-master@tmp/config2948901665383920498tmp 11:58:33 Regular expression run condition: Expression=[^.*logs-s3.*], Label=[odl-logs-s3-cloudfront-index] 11:58:33 Run condition [Regular expression match] enabling perform for step [Provide Configuration files] 11:58:33 provisioning config files... 11:58:34 copy managed file [jenkins-s3-log-ship] to file:/home/jenkins/.aws/credentials 11:58:34 [EnvInject] - Injecting environment variables from a build step. 11:58:34 [EnvInject] - Injecting as environment variables the properties content 11:58:34 SERVER_ID=logs 11:58:34 11:58:34 [EnvInject] - Variables injected successfully. 11:58:34 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins13895549441138414236.sh 11:58:34 ---> create-netrc.sh 11:58:34 WARN: Log server credential not found. 11:58:34 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins15625179099647331319.sh 11:58:34 ---> python-tools-install.sh 11:58:34 Setup pyenv: 11:58:34 system 11:58:34 3.8.20 11:58:34 3.9.20 11:58:34 3.10.15 11:58:34 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 11:58:34 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-pAmy from file:/tmp/.os_lf_venv 11:58:34 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 11:58:34 lf-activate-venv(): INFO: Attempting to install with network-safe options... 11:58:36 lf-activate-venv(): INFO: Base packages installed successfully 11:58:36 lf-activate-venv(): INFO: Installing additional packages: lftools 11:58:45 lf-activate-venv(): INFO: Adding /tmp/venv-pAmy/bin to PATH 11:58:45 [transportpce-tox-verify-transportpce-master] $ /bin/sh /tmp/jenkins8839061370596778041.sh 11:58:45 ---> uv-install.sh 11:58:45 uv 0.11.21 is already installed 11:58:45 uvx 0.11.21 (x86_64-unknown-linux-gnu) 11:58:45 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins7560459649662671486.sh 11:58:45 ---> sudo-logs.sh 11:58:45 Archiving 'sudo' log.. 11:58:46 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins16975818727197106634.sh 11:58:46 ---> job-cost.sh 11:58:46 INFO: Activating Python virtual environment... 11:58:46 Setup pyenv: 11:58:46 system 11:58:46 3.8.20 11:58:46 3.9.20 11:58:46 3.10.15 11:58:46 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 11:58:46 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-pAmy from file:/tmp/.os_lf_venv 11:58:46 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 11:58:46 lf-activate-venv(): INFO: Attempting to install with network-safe options... 11:58:49 lf-activate-venv(): INFO: Base packages installed successfully 11:58:49 lf-activate-venv(): INFO: Installing additional packages: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 11:58:57 lf-activate-venv(): INFO: Adding /tmp/venv-pAmy/bin to PATH 11:58:57 INFO: No stack-cost file found 11:58:57 INFO: Instance uptime: 7286s 11:58:57 INFO: Fetching instance metadata (attempt 1 of 3)... 11:58:57 DEBUG: URL: http://169.254.169.254/latest/meta-data/instance-type 11:58:58 INFO: Successfully fetched instance metadata 11:58:58 INFO: Instance type: v3-standard-4 11:58:58 INFO: Retrieving pricing info for: v3-standard-4 11:58:58 INFO: Fetching Vexxhost pricing API (attempt 1 of 3)... 11:58:58 DEBUG: URL: https://pricing.vexxhost.net/v1/pricing/v3-standard-4/cost?seconds=7286 11:58:58 INFO: Successfully fetched Vexxhost pricing API 11:58:58 INFO: Retrieved cost: 0.33 11:58:58 INFO: Retrieved resource: v3-standard-4 11:58:58 INFO: Creating archive directory: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost 11:58:58 INFO: Archiving costs to: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost.csv 11:58:58 INFO: Successfully archived job cost data 11:58:58 DEBUG: Cost data: transportpce-tox-verify-transportpce-master,5703,2026-06-17 11:58:58,v3-standard-4,7286,0.33,0.00,FAILURE 11:58:58 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins1962002732581095292.sh 11:58:58 ---> logs-deploy.sh 11:58:58 Setup pyenv: 11:58:58 system 11:58:58 3.8.20 11:58:58 3.9.20 11:58:58 3.10.15 11:58:58 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 11:58:58 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-pAmy from file:/tmp/.os_lf_venv 11:58:58 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 11:58:58 lf-activate-venv(): INFO: Attempting to install with network-safe options... 11:59:00 lf-activate-venv(): INFO: Base packages installed successfully 11:59:00 lf-activate-venv(): INFO: Installing additional packages: lftools urllib3~=1.26.15 11:59:10 lf-activate-venv(): INFO: Adding /tmp/venv-pAmy/bin to PATH 11:59:10 WARNING: Nexus logging server not set 11:59:10 INFO: S3 path logs/releng/vex-yul-odl-jenkins-1/transportpce-tox-verify-transportpce-master/5703/ 11:59:10 INFO: archiving logs to S3 11:59:12 ---> uname -a: 11:59:12 Linux prd-ubuntu2204-docker-4c-16g-28057 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux 11:59:12 11:59:12 11:59:12 ---> lscpu: 11:59:12 Architecture: x86_64 11:59:12 CPU op-mode(s): 32-bit, 64-bit 11:59:12 Address sizes: 40 bits physical, 48 bits virtual 11:59:12 Byte Order: Little Endian 11:59:12 CPU(s): 4 11:59:12 On-line CPU(s) list: 0-3 11:59:12 Vendor ID: AuthenticAMD 11:59:12 Model name: AMD EPYC-Rome Processor 11:59:12 CPU family: 23 11:59:12 Model: 49 11:59:12 Thread(s) per core: 1 11:59:12 Core(s) per socket: 1 11:59:12 Socket(s): 4 11:59:12 Stepping: 0 11:59:12 BogoMIPS: 5599.99 11:59:12 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr wbnoinvd arat npt nrip_save umip rdpid arch_capabilities 11:59:12 Virtualization: AMD-V 11:59:12 Hypervisor vendor: KVM 11:59:12 Virtualization type: full 11:59:12 L1d cache: 128 KiB (4 instances) 11:59:12 L1i cache: 128 KiB (4 instances) 11:59:12 L2 cache: 2 MiB (4 instances) 11:59:12 L3 cache: 64 MiB (4 instances) 11:59:12 NUMA node(s): 1 11:59:12 NUMA node0 CPU(s): 0-3 11:59:12 Vulnerability Gather data sampling: Not affected 11:59:12 Vulnerability Indirect target selection: Not affected 11:59:12 Vulnerability Itlb multihit: Not affected 11:59:12 Vulnerability L1tf: Not affected 11:59:12 Vulnerability Mds: Not affected 11:59:12 Vulnerability Meltdown: Not affected 11:59:12 Vulnerability Mmio stale data: Not affected 11:59:12 Vulnerability Reg file data sampling: Not affected 11:59:12 Vulnerability Retbleed: Mitigation; untrained return thunk; SMT disabled 11:59:12 Vulnerability Spec rstack overflow: Mitigation; SMT disabled 11:59:12 Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp 11:59:12 Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization 11:59:12 Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected 11:59:12 Vulnerability Srbds: Not affected 11:59:12 Vulnerability Tsa: Not affected 11:59:12 Vulnerability Tsx async abort: Not affected 11:59:12 Vulnerability Vmscape: Not affected 11:59:12 11:59:12 11:59:12 ---> nproc: 11:59:12 4 11:59:12 11:59:12 11:59:12 ---> df -h: 11:59:12 Filesystem Size Used Avail Use% Mounted on 11:59:12 tmpfs 1.6G 1.1M 1.6G 1% /run 11:59:12 /dev/vda1 78G 18G 60G 23% / 11:59:12 tmpfs 7.9G 0 7.9G 0% /dev/shm 11:59:12 tmpfs 5.0M 0 5.0M 0% /run/lock 11:59:12 /dev/vda15 105M 6.1M 99M 6% /boot/efi 11:59:12 tmpfs 1.6G 4.0K 1.6G 1% /run/user/1001 11:59:12 11:59:12 11:59:12 ---> free -m: 11:59:12 total used free shared buff/cache available 11:59:12 Mem: 15989 716 11736 3 3536 14930 11:59:12 Swap: 1023 0 1023 11:59:12 11:59:12 11:59:12 ---> ip addr: 11:59:12 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 11:59:12 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 11:59:12 inet 127.0.0.1/8 scope host lo 11:59:12 valid_lft forever preferred_lft forever 11:59:12 inet6 ::1/128 scope host 11:59:12 valid_lft forever preferred_lft forever 11:59:12 2: ens3: mtu 1458 qdisc mq state UP group default qlen 1000 11:59:12 link/ether fa:16:3e:c2:6c:a0 brd ff:ff:ff:ff:ff:ff 11:59:12 altname enp0s3 11:59:12 inet 10.30.171.54/23 metric 100 brd 10.30.171.255 scope global dynamic ens3 11:59:12 valid_lft 79107sec preferred_lft 79107sec 11:59:12 inet6 fe80::f816:3eff:fec2:6ca0/64 scope link 11:59:12 valid_lft forever preferred_lft forever 11:59:12 3: docker0: mtu 1458 qdisc noqueue state DOWN group default 11:59:12 link/ether 22:36:e0:3d:28:f5 brd ff:ff:ff:ff:ff:ff 11:59:12 inet 10.250.0.254/24 brd 10.250.0.255 scope global docker0 11:59:12 valid_lft forever preferred_lft forever 11:59:12 inet6 fe80::2036:e0ff:fe3d:28f5/64 scope link 11:59:12 valid_lft forever preferred_lft forever 11:59:12 11:59:12 11:59:12 ---> sar -b -r -n DEV: 11:59:12 Linux 5.15.0-174-generic (prd-ubuntu2204-docker-4c-16g-28057) 06/17/26 _x86_64_ (4 CPU) 11:59:12 11:59:12 09:57:42 LINUX RESTART (4 CPU) 11:59:12 11:59:12 10:00:03 tps rtps wtps dtps bread/s bwrtn/s bdscd/s 11:59:12 10:10:15 139.70 10.27 123.98 5.45 842.39 38042.71 12096.40 11:59:12 10:20:15 11.99 3.07 8.50 0.42 77.51 231.51 274.38 11:59:12 10:30:15 9.21 0.17 8.58 0.47 14.32 298.64 506.87 11:59:12 10:40:15 20.97 2.01 2.91 16.05 93.59 77.87 210826.79 11:59:12 10:50:15 18.72 0.12 17.87 0.73 9.77 755.60 1204.23 11:59:12 11:00:15 12.08 0.01 11.59 0.48 0.61 369.23 236.64 11:59:12 11:10:01 5.11 0.00 4.96 0.14 0.16 136.23 79.62 11:59:12 11:20:01 5.74 0.02 5.54 0.18 1.95 167.53 139.01 11:59:12 11:30:01 5.75 0.00 5.56 0.18 0.31 165.68 87.35 11:59:12 11:40:01 11.64 0.05 11.21 0.37 2.17 577.92 137.76 11:59:12 11:50:15 4.80 0.01 4.66 0.13 0.36 156.99 142.27 11:59:12 Average: 22.55 1.45 18.86 2.24 96.19 3787.63 20505.94 11:59:12 11:59:12 10:00:03 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 11:59:12 10:10:15 1875784 4120720 11813516 72.15 261528 2042200 13320168 76.46 1685052 12300552 2936 11:59:12 10:20:15 8836616 11122788 4817144 29.42 263664 2081604 5601724 32.15 1743652 5304120 44 11:59:12 10:30:15 8105852 10415584 5524988 33.74 265332 2103476 7342296 42.14 1759724 6028892 772 11:59:12 10:40:15 12919124 15305268 636524 3.89 270500 2174960 1377132 7.90 1772728 1209004 39336 11:59:12 10:50:15 10387796 12879988 3061148 18.70 274144 2277096 3816860 21.91 1798308 3711124 64 11:59:12 11:00:15 8814432 11361148 4579188 27.97 276008 2329760 5336672 30.63 1803312 5266936 36 11:59:12 11:10:01 8786728 11350964 4589508 28.03 276812 2346472 5359668 30.76 1804772 5292876 520 11:59:12 11:20:01 7197084 9784500 6155096 37.59 277504 2368960 6849024 39.31 1807372 6881352 240 11:59:12 11:30:01 7285024 9895604 6043956 36.91 278280 2391352 6807872 39.08 1810952 6787204 264 11:59:12 11:40:01 8549816 11284852 4655512 28.43 282132 2511556 5399084 30.99 1843136 5500524 92 11:59:12 11:50:15 8389040 11150204 4789968 29.26 282468 2537272 5408112 31.04 1851236 5644644 136 11:59:12 Average: 8286118 10788329 5151504 31.46 273488 2287701 6056237 34.76 1789113 5811566 4040 11:59:12 11:59:12 10:00:03 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 11:59:12 10:10:15 lo 19.05 19.05 15.02 15.02 0.00 0.00 0.00 0.00 11:59:12 10:10:15 ens3 114.39 88.47 1617.39 9.51 0.00 0.00 0.00 0.00 11:59:12 10:10:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 10:20:15 lo 16.02 16.02 9.85 9.85 0.00 0.00 0.00 0.00 11:59:12 10:20:15 ens3 1.81 1.07 0.45 1.29 0.00 0.00 0.00 0.00 11:59:12 10:20:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 10:30:15 lo 10.45 10.45 5.75 5.75 0.00 0.00 0.00 0.00 11:59:12 10:30:15 ens3 0.70 0.56 0.14 0.10 0.00 0.00 0.00 0.00 11:59:12 10:30:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 10:40:15 lo 9.69 9.69 5.04 5.04 0.00 0.00 0.00 0.00 11:59:12 10:40:15 ens3 0.46 0.29 0.14 0.09 0.00 0.00 0.00 0.00 11:59:12 10:40:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 10:50:15 lo 10.07 10.07 4.84 4.84 0.00 0.00 0.00 0.00 11:59:12 10:50:15 ens3 0.86 0.78 0.43 0.16 0.00 0.00 0.00 0.00 11:59:12 10:50:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:00:15 lo 17.03 17.03 9.49 9.49 0.00 0.00 0.00 0.00 11:59:12 11:00:15 ens3 0.90 0.75 0.18 1.24 0.00 0.00 0.00 0.00 11:59:12 11:00:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:10:01 lo 12.81 12.81 5.72 5.72 0.00 0.00 0.00 0.00 11:59:12 11:10:01 ens3 0.68 0.49 0.15 0.11 0.00 0.00 0.00 0.00 11:59:12 11:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:20:01 lo 28.22 28.22 11.25 11.25 0.00 0.00 0.00 0.00 11:59:12 11:20:01 ens3 0.54 0.42 0.11 0.08 0.00 0.00 0.00 0.00 11:59:12 11:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:30:01 lo 19.91 19.91 10.71 10.71 0.00 0.00 0.00 0.00 11:59:12 11:30:01 ens3 0.88 0.63 0.20 0.15 0.00 0.00 0.00 0.00 11:59:12 11:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:40:01 lo 16.39 16.39 9.83 9.83 0.00 0.00 0.00 0.00 11:59:12 11:40:01 ens3 7.02 0.88 1.23 0.35 0.00 0.00 0.00 0.00 11:59:12 11:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:50:15 lo 15.30 15.30 6.32 6.32 0.00 0.00 0.00 0.00 11:59:12 11:50:15 ens3 1.83 0.48 0.26 0.10 0.00 0.00 0.00 0.00 11:59:12 11:50:15 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 Average: lo 15.92 15.92 8.54 8.54 0.00 0.00 0.00 0.00 11:59:12 Average: ens3 12.01 8.76 149.99 1.21 0.00 0.00 0.00 0.00 11:59:12 Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 11:59:12 11:59:12 11:59:12 ---> sar -P ALL: 11:59:12 Linux 5.15.0-174-generic (prd-ubuntu2204-docker-4c-16g-28057) 06/17/26 _x86_64_ (4 CPU) 11:59:12 11:59:12 09:57:42 LINUX RESTART (4 CPU) 11:59:12 11:59:12 10:00:03 CPU %user %nice %system %iowait %steal %idle 11:59:12 10:10:15 all 66.25 0.00 3.12 2.05 0.11 28.48 11:59:12 10:10:15 0 67.67 0.00 3.05 2.12 0.11 27.04 11:59:12 10:10:15 1 65.96 0.00 3.31 2.18 0.11 28.43 11:59:12 10:10:15 2 66.34 0.00 2.78 1.80 0.11 28.98 11:59:12 10:10:15 3 65.01 0.00 3.32 2.10 0.11 29.46 11:59:12 10:20:15 all 15.71 0.00 0.70 0.07 0.09 83.42 11:59:12 10:20:15 0 16.23 0.00 0.75 0.05 0.08 82.89 11:59:12 10:20:15 1 15.74 0.00 0.67 0.04 0.09 83.46 11:59:12 10:20:15 2 15.72 0.00 0.70 0.13 0.09 83.36 11:59:12 10:20:15 3 15.17 0.00 0.68 0.07 0.09 83.98 11:59:12 10:30:15 all 20.87 0.00 0.78 0.13 0.08 78.14 11:59:12 10:30:15 0 20.66 0.00 0.76 0.13 0.08 78.37 11:59:12 10:30:15 1 20.86 0.00 0.90 0.11 0.09 78.04 11:59:12 10:30:15 2 20.16 0.00 0.79 0.17 0.09 78.79 11:59:12 10:30:15 3 21.78 0.00 0.68 0.11 0.07 77.36 11:59:12 10:40:15 all 5.32 0.00 0.30 0.19 0.06 94.13 11:59:12 10:40:15 0 5.43 0.00 0.32 0.38 0.07 93.81 11:59:12 10:40:15 1 5.53 0.00 0.32 0.04 0.07 94.05 11:59:12 10:40:15 2 5.24 0.00 0.26 0.18 0.06 94.27 11:59:12 10:40:15 3 5.07 0.00 0.29 0.19 0.06 94.39 11:59:12 10:50:15 all 25.27 0.00 0.83 0.11 0.08 73.71 11:59:12 10:50:15 0 25.38 0.00 0.77 0.07 0.08 73.70 11:59:12 10:50:15 1 26.02 0.00 0.90 0.08 0.09 72.91 11:59:12 10:50:15 2 24.07 0.00 0.82 0.12 0.08 74.92 11:59:12 10:50:15 3 25.60 0.00 0.83 0.16 0.08 73.33 11:59:12 11:00:15 all 21.00 0.00 0.69 0.04 0.07 78.20 11:59:12 11:00:15 0 21.49 0.00 0.59 0.08 0.07 77.77 11:59:12 11:00:15 1 20.12 0.00 0.71 0.01 0.07 79.08 11:59:12 11:00:15 2 21.17 0.00 0.64 0.04 0.08 78.07 11:59:12 11:00:15 3 21.22 0.00 0.80 0.02 0.07 77.89 11:59:12 11:10:01 all 7.97 0.00 0.44 0.04 0.07 91.49 11:59:12 11:10:01 0 7.83 0.00 0.33 0.03 0.06 91.74 11:59:12 11:10:01 1 7.72 0.00 0.46 0.02 0.07 91.73 11:59:12 11:10:01 2 8.23 0.00 0.53 0.01 0.07 91.15 11:59:12 11:10:01 3 8.08 0.00 0.45 0.09 0.07 91.31 11:59:12 11:20:01 all 10.91 0.00 0.51 0.28 0.07 88.23 11:59:12 11:20:01 0 10.69 0.00 0.55 0.22 0.07 88.48 11:59:12 11:20:01 1 10.91 0.00 0.56 0.23 0.07 88.22 11:59:12 11:20:01 2 10.95 0.00 0.46 0.65 0.07 87.87 11:59:12 11:20:01 3 11.11 0.00 0.46 0.02 0.06 88.35 11:59:12 11:30:01 all 10.43 0.00 0.53 0.02 0.07 88.95 11:59:12 11:30:01 0 10.33 0.00 0.51 0.03 0.07 89.07 11:59:12 11:30:01 1 10.51 0.00 0.53 0.03 0.07 88.86 11:59:12 11:30:01 2 10.51 0.00 0.53 0.02 0.07 88.87 11:59:12 11:30:01 3 10.39 0.00 0.54 0.00 0.07 89.00 11:59:12 11:40:01 all 14.13 0.00 0.61 0.19 0.07 84.98 11:59:12 11:40:01 0 14.43 0.00 0.58 0.03 0.07 84.89 11:59:12 11:40:01 1 14.78 0.00 0.67 0.18 0.07 84.30 11:59:12 11:40:01 2 13.42 0.00 0.64 0.33 0.08 85.52 11:59:12 11:40:01 3 13.91 0.00 0.56 0.23 0.07 85.23 11:59:12 11:50:15 all 7.80 0.00 0.40 0.06 0.07 91.67 11:59:12 11:50:15 0 7.17 0.00 0.40 0.02 0.07 92.34 11:59:12 11:50:15 1 8.03 0.00 0.44 0.13 0.07 91.34 11:59:12 11:50:15 2 7.99 0.00 0.40 0.06 0.07 91.48 11:59:12 11:50:15 3 8.02 0.00 0.35 0.03 0.06 91.53 11:59:12 11:59:12 Average: CPU %user %nice %system %iowait %steal %idle 11:59:12 Average: all 18.78 0.00 0.81 0.29 0.08 80.04 11:59:12 Average: 0 18.93 0.00 0.79 0.29 0.08 79.92 11:59:12 Average: 1 18.83 0.00 0.87 0.28 0.08 79.95 11:59:12 Average: 2 18.61 0.00 0.78 0.32 0.08 80.21 11:59:12 Average: 3 18.75 0.00 0.82 0.28 0.07 80.08 11:59:12 11:59:12 11:59:12