08:51:43 Triggered by Gerrit: https://git.opendaylight.org/gerrit/c/transportpce/+/120829 08:51:43 Running as SYSTEM 08:51:43 [EnvInject] - Loading node environment variables. 08:51:43 Building remotely on prd-ubuntu2204-docker-4c-16g-28425 (ubuntu2204-docker-4c-16g) in workspace /w/workspace/transportpce-tox-verify-transportpce-master 08:51:44 [ssh-agent] Looking for ssh-agent implementation... 08:51:44 [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) 08:51:44 $ ssh-agent 08:51:44 SSH_AUTH_SOCK=/tmp/ssh-XXXXXXz5Ag5s/agent.7297 08:51:44 SSH_AGENT_PID=7299 08:51:44 [ssh-agent] Started. 08:51:44 Running ssh-add (command line suppressed) 08:51:44 Identity added: /w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_13365873249304984348.key (/w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_13365873249304984348.key) 08:51:44 [ssh-agent] Using credentials jenkins (jenkins-ssh) 08:51:44 The recommended git tool is: NONE 08:51:46 using credential jenkins-ssh 08:51:46 Wiping out workspace first. 08:51:46 Cloning the remote Git repository 08:51:46 Cloning repository git://devvexx.opendaylight.org/mirror/transportpce 08:51:46 > git init /w/workspace/transportpce-tox-verify-transportpce-master # timeout=10 08:51:46 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 08:51:46 > git --version # timeout=10 08:51:46 > git --version # 'git version 2.34.1' 08:51:46 using GIT_SSH to set credentials jenkins-ssh 08:51:46 Verifying host key using known hosts file, will automatically accept unseen keys 08:51:46 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce +refs/heads/*:refs/remotes/origin/* # timeout=10 08:51:50 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 08:51:50 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 08:51:50 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 08:51:50 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 08:51:50 using GIT_SSH to set credentials jenkins-ssh 08:51:50 Verifying host key using known hosts file, will automatically accept unseen keys 08:51:50 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce refs/changes/29/120829/16 # timeout=10 08:51:50 > git rev-parse 9807835815351991c9735ca9737afcc780a60e3c^{commit} # timeout=10 08:51:50 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script 08:51:50 Checking out Revision 9807835815351991c9735ca9737afcc780a60e3c (refs/changes/29/120829/16) 08:51:51 > git config core.sparsecheckout # timeout=10 08:51:51 > git checkout -f 9807835815351991c9735ca9737afcc780a60e3c # timeout=10 08:51:51 Commit message: "Support for openconfig 2.0" 08:51:51 > git rev-parse FETCH_HEAD^{commit} # timeout=10 08:51:51 > git rev-list --no-walk f6d12910d5094a7663243830395c69423a66f1b9 # timeout=10 08:51:51 > git remote # timeout=10 08:51:51 > git submodule init # timeout=10 08:51:51 > git submodule sync # timeout=10 08:51:51 > git config --get remote.origin.url # timeout=10 08:51:51 > git submodule init # timeout=10 08:51:51 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 08:51:51 ERROR: No submodules found. 08:51:54 provisioning config files... 08:51:54 copy managed file [npmrc] to file:/home/jenkins/.npmrc 08:51:54 copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf 08:51:54 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins10763488305019992573.sh 08:51:54 ---> python-tools-install.sh 08:51:54 Setup pyenv: 08:51:54 * system (set by /opt/pyenv/version) 08:51:54 * 3.8.20 (set by /opt/pyenv/version) 08:51:54 * 3.9.20 (set by /opt/pyenv/version) 08:51:54 3.10.15 08:51:54 3.11.10 08:51:59 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-E43A 08:51:59 lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv 08:51:59 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:51:59 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:52:03 lf-activate-venv(): INFO: Base packages installed successfully 08:52:03 lf-activate-venv(): INFO: Installing additional packages: lftools 08:52:29 lf-activate-venv(): INFO: Adding /tmp/venv-E43A/bin to PATH 08:52:29 Generating Requirements File 08:52:57 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. 08:52:57 httplib2 0.30.2 requires pyparsing<4,>=3.0.4, but you have pyparsing 2.4.7 which is incompatible. 08:52:57 Python 3.11.10 08:52:57 pip 26.1.2 from /tmp/venv-E43A/lib/python3.11/site-packages/pip (python 3.11) 08:52:58 aiohappyeyeballs==2.6.2 08:52:58 aiohttp==3.14.1 08:52:58 aiosignal==1.4.0 08:52:58 appdirs==1.4.4 08:52:58 argcomplete==3.6.3 08:52:58 aspy.yaml==1.3.0 08:52:58 attrs==26.1.0 08:52:58 autopage==0.6.0 08:52:58 beautifulsoup4==4.15.0 08:52:58 boto3==1.43.33 08:52:58 botocore==1.43.33 08:52:58 bs4==0.0.2 08:52:58 certifi==2026.6.17 08:52:58 cffi==2.0.0 08:52:58 cfgv==3.5.0 08:52:58 chardet==7.4.3 08:52:58 charset-normalizer==3.4.7 08:52:58 click==8.4.1 08:52:58 cliff==4.14.0 08:52:58 cmd2==4.0.0 08:52:58 cryptography==3.3.2 08:52:58 debtcollector==3.1.0 08:52:58 decorator==5.3.1 08:52:58 defusedxml==0.7.1 08:52:58 Deprecated==1.3.1 08:52:58 distlib==0.4.3 08:52:58 dnspython==2.8.0 08:52:58 docker==7.1.0 08:52:58 dogpile.cache==1.5.0 08:52:58 durationpy==0.10 08:52:58 email-validator==2.3.0 08:52:58 filelock==3.29.4 08:52:58 frozenlist==1.8.0 08:52:58 future==1.0.0 08:52:58 gitdb==4.0.12 08:52:58 GitPython==3.1.50 08:52:58 httplib2==0.30.2 08:52:58 identify==2.6.19 08:52:58 idna==3.18 08:52:58 importlib-resources==1.5.0 08:52:58 iso8601==2.1.0 08:52:58 Jinja2==3.1.6 08:52:58 jmespath==1.1.0 08:52:58 jsonpatch==1.33 08:52:58 jsonpointer==3.1.1 08:52:58 jsonschema==4.26.0 08:52:58 jsonschema-specifications==2025.9.1 08:52:58 keystoneauth1==5.14.0 08:52:58 kubernetes==36.0.2 08:52:58 lftools==0.37.22 08:52:58 lxml==6.1.1 08:52:58 markdown-it-py==4.2.0 08:52:58 MarkupSafe==3.0.3 08:52:58 mdurl==0.1.2 08:52:58 msgpack==1.2.1 08:52:58 multi_key_dict==2.0.3 08:52:58 multidict==6.7.1 08:52:58 munch==4.0.0 08:52:58 netaddr==1.3.0 08:52:58 niet==1.4.2 08:52:58 nodeenv==1.10.0 08:52:58 oauth2client==4.1.3 08:52:58 oauthlib==3.3.1 08:52:58 openstacksdk==4.16.0 08:52:58 os-service-types==1.8.2 08:52:58 osc-lib==4.6.0 08:52:58 oslo.config==10.5.0 08:52:58 oslo.context==6.4.0 08:52:58 oslo.i18n==6.8.0 08:52:58 oslo.log==8.2.0 08:52:58 oslo.serialization==5.10.0 08:52:58 oslo.utils==10.1.1 08:52:58 packaging==26.2 08:52:58 pbr==7.0.3 08:52:58 platformdirs==4.10.0 08:52:58 prettytable==3.17.0 08:52:58 prompt_toolkit==3.0.52 08:52:58 propcache==0.5.2 08:52:58 psutil==7.2.2 08:52:58 pyasn1==0.6.3 08:52:58 pyasn1_modules==0.4.2 08:52:58 pycparser==3.0 08:52:58 pygerrit2==2.0.15 08:52:58 PyGithub==2.9.1 08:52:58 Pygments==2.20.0 08:52:58 PyJWT==2.13.0 08:52:58 PyNaCl==1.6.2 08:52:58 pyparsing==2.4.7 08:52:58 pyperclip==1.11.0 08:52:58 pyrsistent==0.20.0 08:52:58 python-cinderclient==9.9.0 08:52:58 python-dateutil==2.9.0.post0 08:52:58 python-discovery==1.4.2 08:52:58 python-heatclient==5.2.0 08:52:58 python-jenkins==1.8.3 08:52:58 python-keystoneclient==5.8.0 08:52:58 python-magnumclient==4.10.0 08:52:58 python-openstackclient==10.1.0 08:52:58 python-swiftclient==4.10.0 08:52:58 PyYAML==6.0.3 08:52:58 referencing==0.37.0 08:52:58 requests==2.34.2 08:52:58 requests-oauthlib==2.0.0 08:52:58 rfc3986==2.0.0 08:52:58 rich==15.0.0 08:52:58 rich-argparse==1.8.0 08:52:58 rpds-py==2026.5.1 08:52:58 rsa==4.9.1 08:52:58 ruamel.yaml==0.19.1 08:52:58 ruamel.yaml.clib==0.2.15 08:52:58 s3transfer==0.19.0 08:52:58 simplejson==4.1.1 08:52:58 six==1.17.0 08:52:58 smmap==5.0.3 08:52:58 soupsieve==2.8.4 08:52:58 stevedore==5.8.0 08:52:58 tabulate==0.10.0 08:52:58 toml==0.10.2 08:52:58 tomlkit==0.15.0 08:52:58 tqdm==4.68.3 08:52:58 typing_extensions==4.15.0 08:52:58 urllib3==1.26.20 08:52:58 virtualenv==21.5.1 08:52:58 wcwidth==0.8.1 08:52:58 websocket-client==1.9.0 08:52:58 wrapt==2.2.1 08:52:58 xdg==6.0.0 08:52:58 xmltodict==1.0.4 08:52:58 yarl==1.24.2 08:52:58 yq==3.4.3 08:52:58 [transportpce-tox-verify-transportpce-master] $ /bin/sh /tmp/jenkins4137742534852574018.sh 08:52:58 ---> uv-install.sh 08:52:58 Installing uv/uvx (latest) using shell installer 08:52:58 2026-06-19 08:52:58 URL:https://releases.astral.sh/installers/uv/latest/uv-installer.sh [71233/71233] -> "/tmp/uv-install-U9kf7e.sh" [1] 08:52:58 downloading uv 0.11.22 x86_64-unknown-linux-gnu 08:52:59 installing to /home/jenkins/.local/bin 08:52:59 uv 08:52:59 uvx 08:52:59 everything's installed! 08:52:59 08:52:59 To add $HOME/.local/bin to your PATH, either restart your shell or run: 08:52:59 08:52:59 source $HOME/.local/bin/env (sh, bash, zsh) 08:52:59 source $HOME/.local/bin/env.fish (fish) 08:52:59 Adding install location to PATH 08:52:59 ---> Validating uv/uvx install 08:52:59 uvx 0.11.22 (x86_64-unknown-linux-gnu) 08:52:59 [EnvInject] - Injecting environment variables from a build step. 08:52:59 [EnvInject] - Injecting as environment variables the properties content 08:52:59 PYTHON=python3 08:52:59 08:52:59 [EnvInject] - Variables injected successfully. 08:52:59 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins16016907523115670068.sh 08:52:59 ---> tox-install.sh 08:52:59 + source /home/jenkins/lf-env.sh 08:52:59 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 08:52:59 ++ mktemp -d /tmp/venv-XXXX 08:52:59 + lf_venv=/tmp/venv-oQQC 08:52:59 + local venv_file=/tmp/.os_lf_venv 08:52:59 + local python=python3 08:52:59 + local options 08:52:59 + local set_path=true 08:52:59 + local install_args= 08:52:59 ++ 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 08:52:59 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 08:52:59 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 08:52:59 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 08:52:59 + true 08:52:59 + case $1 in 08:52:59 + venv_file=/tmp/.toxenv 08:52:59 + shift 2 08:52:59 + true 08:52:59 + case $1 in 08:52:59 + shift 08:52:59 + break 08:52:59 + case $python in 08:52:59 + local pkg_list= 08:52:59 + [[ -d /opt/pyenv ]] 08:52:59 + echo 'Setup pyenv:' 08:52:59 Setup pyenv: 08:52:59 + export PYENV_ROOT=/opt/pyenv 08:52:59 + PYENV_ROOT=/opt/pyenv 08:52:59 + 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 08:52:59 + 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 08:52:59 + pyenv versions 08:52:59 system 08:52:59 3.8.20 08:52:59 3.9.20 08:52:59 3.10.15 08:52:59 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:52:59 + command -v pyenv 08:52:59 ++ pyenv init - --no-rehash 08:52:59 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 08:52:59 for i in ${!paths[@]}; do 08:52:59 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 08:52:59 fi; done; 08:52:59 echo "${paths[*]}"'\'')" 08:52:59 export PATH="/opt/pyenv/shims:${PATH}" 08:52:59 export PYENV_SHELL=bash 08:52:59 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 08:52:59 pyenv() { 08:52:59 local command 08:52:59 command="${1:-}" 08:52:59 if [ "$#" -gt 0 ]; then 08:52:59 shift 08:52:59 fi 08:52:59 08:52:59 case "$command" in 08:52:59 rehash|shell) 08:52:59 eval "$(pyenv "sh-$command" "$@")" 08:52:59 ;; 08:52:59 *) 08:52:59 command pyenv "$command" "$@" 08:52:59 ;; 08:52:59 esac 08:52:59 }' 08:52:59 +++ bash --norc -ec 'IFS=:; paths=($PATH); 08:52:59 for i in ${!paths[@]}; do 08:52:59 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 08:52:59 fi; done; 08:52:59 echo "${paths[*]}"' 08:52:59 ++ 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 08:52:59 ++ 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 08:52:59 ++ 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 08:52:59 ++ export PYENV_SHELL=bash 08:52:59 ++ PYENV_SHELL=bash 08:52:59 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 08:52:59 +++ complete -F _pyenv pyenv 08:52:59 ++ lf-pyver python3 08:52:59 ++ local py_version_xy=python3 08:52:59 ++ local py_version_xyz= 08:52:59 ++ pyenv versions 08:52:59 ++ local command 08:52:59 ++ sed 's/^[ *]* //' 08:52:59 ++ command=versions 08:52:59 ++ '[' 1 -gt 0 ']' 08:52:59 ++ shift 08:52:59 ++ awk '{ print $1 }' 08:52:59 ++ case "$command" in 08:52:59 ++ grep -E '^[0-9.]*[0-9]$' 08:52:59 ++ command pyenv versions 08:52:59 ++ [[ ! -s /tmp/.pyenv_versions ]] 08:52:59 +++ grep '^3' /tmp/.pyenv_versions 08:52:59 +++ sort -V 08:52:59 +++ tail -n 1 08:52:59 ++ py_version_xyz=3.11.10 08:52:59 ++ [[ -z 3.11.10 ]] 08:52:59 ++ echo 3.11.10 08:52:59 ++ return 0 08:52:59 + pyenv local 3.11.10 08:52:59 + local command 08:52:59 + command=local 08:52:59 + '[' 2 -gt 0 ']' 08:52:59 + shift 08:52:59 + case "$command" in 08:52:59 + command pyenv local 3.11.10 08:52:59 + for arg in "$@" 08:52:59 + case $arg in 08:52:59 + pkg_list+='tox ' 08:52:59 + for arg in "$@" 08:52:59 + case $arg in 08:52:59 + pkg_list+='virtualenv ' 08:52:59 + for arg in "$@" 08:52:59 + case $arg in 08:52:59 + pkg_list+='urllib3~=1.26.15 ' 08:52:59 + [[ -f /tmp/.toxenv ]] 08:52:59 + [[ ! -f /tmp/.toxenv ]] 08:52:59 + [[ -n '' ]] 08:52:59 + python3 -m venv /tmp/venv-oQQC 08:53:04 + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-oQQC' 08:53:04 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-oQQC 08:53:04 + echo /tmp/venv-oQQC 08:53:04 + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' 08:53:04 lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv 08:53:04 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 08:53:04 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:53:04 + local 'pip_opts=--upgrade --quiet' 08:53:04 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 08:53:04 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 08:53:04 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 08:53:04 + [[ -n '' ]] 08:53:04 + [[ -n '' ]] 08:53:04 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 08:53:04 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:53:04 + /tmp/venv-oQQC/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 08:53:08 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 08:53:08 lf-activate-venv(): INFO: Base packages installed successfully 08:53:08 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 08:53:08 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 08:53:08 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 08:53:08 + /tmp/venv-oQQC/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 08:53:10 + type python3 08:53:10 + true 08:53:10 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-oQQC/bin to PATH' 08:53:10 lf-activate-venv(): INFO: Adding /tmp/venv-oQQC/bin to PATH 08:53:10 + PATH=/tmp/venv-oQQC/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 08:53:10 + return 0 08:53:10 + python3 --version 08:53:10 Python 3.11.10 08:53:10 + python3 -m pip --version 08:53:10 pip 26.1.2 from /tmp/venv-oQQC/lib/python3.11/site-packages/pip (python 3.11) 08:53:10 + python3 -m pip freeze 08:53:10 cachetools==7.1.4 08:53:10 colorama==0.4.6 08:53:10 distlib==0.4.3 08:53:10 filelock==3.29.4 08:53:10 packaging==26.2 08:53:10 platformdirs==4.10.0 08:53:10 pluggy==1.6.0 08:53:10 pyproject-api==1.10.1 08:53:10 python-discovery==1.4.2 08:53:10 tomli_w==1.2.0 08:53:10 tox==4.55.1 08:53:10 urllib3==1.26.20 08:53:10 virtualenv==21.5.1 08:53:10 [transportpce-tox-verify-transportpce-master] $ /bin/sh -xe /tmp/jenkins5167535512590439323.sh 08:53:10 [EnvInject] - Injecting environment variables from a build step. 08:53:10 [EnvInject] - Injecting as environment variables the properties content 08:53:10 PARALLEL=True 08:53:10 08:53:10 [EnvInject] - Variables injected successfully. 08:53:10 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins15711882199395888446.sh 08:53:10 ---> tox-run.sh 08:53:10 + 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 08:53:10 + ARCHIVE_TOX_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 08:53:10 + ARCHIVE_DOC_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 08:53:10 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 08:53:10 + cd /w/workspace/transportpce-tox-verify-transportpce-master/. 08:53:10 + source /home/jenkins/lf-env.sh 08:53:10 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 08:53:10 ++ mktemp -d /tmp/venv-XXXX 08:53:10 + lf_venv=/tmp/venv-QHoV 08:53:10 + local venv_file=/tmp/.os_lf_venv 08:53:10 + local python=python3 08:53:10 + local options 08:53:10 + local set_path=true 08:53:10 + local install_args= 08:53:10 ++ 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 08:53:10 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 08:53:10 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 08:53:10 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 08:53:10 + true 08:53:10 + case $1 in 08:53:10 + venv_file=/tmp/.toxenv 08:53:10 + shift 2 08:53:10 + true 08:53:10 + case $1 in 08:53:10 + shift 08:53:10 + break 08:53:10 + case $python in 08:53:10 + local pkg_list= 08:53:10 + [[ -d /opt/pyenv ]] 08:53:10 + echo 'Setup pyenv:' 08:53:10 Setup pyenv: 08:53:10 + export PYENV_ROOT=/opt/pyenv 08:53:10 + PYENV_ROOT=/opt/pyenv 08:53:10 + 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 08:53:10 + 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 08:53:10 + pyenv versions 08:53:10 system 08:53:10 3.8.20 08:53:10 3.9.20 08:53:10 3.10.15 08:53:10 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:53:10 + command -v pyenv 08:53:10 ++ pyenv init - --no-rehash 08:53:10 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 08:53:10 for i in ${!paths[@]}; do 08:53:10 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 08:53:10 fi; done; 08:53:10 echo "${paths[*]}"'\'')" 08:53:10 export PATH="/opt/pyenv/shims:${PATH}" 08:53:10 export PYENV_SHELL=bash 08:53:10 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 08:53:10 pyenv() { 08:53:10 local command 08:53:10 command="${1:-}" 08:53:10 if [ "$#" -gt 0 ]; then 08:53:10 shift 08:53:10 fi 08:53:10 08:53:10 case "$command" in 08:53:10 rehash|shell) 08:53:10 eval "$(pyenv "sh-$command" "$@")" 08:53:10 ;; 08:53:10 *) 08:53:10 command pyenv "$command" "$@" 08:53:10 ;; 08:53:10 esac 08:53:10 }' 08:53:10 +++ bash --norc -ec 'IFS=:; paths=($PATH); 08:53:10 for i in ${!paths[@]}; do 08:53:10 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 08:53:10 fi; done; 08:53:10 echo "${paths[*]}"' 08:53:10 ++ 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 08:53:10 ++ 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 08:53:10 ++ 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 08:53:10 ++ export PYENV_SHELL=bash 08:53:10 ++ PYENV_SHELL=bash 08:53:10 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 08:53:10 +++ complete -F _pyenv pyenv 08:53:10 ++ lf-pyver python3 08:53:10 ++ local py_version_xy=python3 08:53:10 ++ local py_version_xyz= 08:53:10 ++ pyenv versions 08:53:10 ++ local command 08:53:10 ++ command=versions 08:53:10 ++ '[' 1 -gt 0 ']' 08:53:10 ++ shift 08:53:10 ++ case "$command" in 08:53:10 ++ command pyenv versions 08:53:10 ++ sed 's/^[ *]* //' 08:53:10 ++ awk '{ print $1 }' 08:53:10 ++ grep -E '^[0-9.]*[0-9]$' 08:53:11 ++ [[ ! -s /tmp/.pyenv_versions ]] 08:53:11 +++ grep '^3' /tmp/.pyenv_versions 08:53:11 +++ tail -n 1 08:53:11 +++ sort -V 08:53:11 ++ py_version_xyz=3.11.10 08:53:11 ++ [[ -z 3.11.10 ]] 08:53:11 ++ echo 3.11.10 08:53:11 ++ return 0 08:53:11 + pyenv local 3.11.10 08:53:11 + local command 08:53:11 + command=local 08:53:11 + '[' 2 -gt 0 ']' 08:53:11 + shift 08:53:11 + case "$command" in 08:53:11 + command pyenv local 3.11.10 08:53:11 + for arg in "$@" 08:53:11 + case $arg in 08:53:11 + pkg_list+='tox ' 08:53:11 + for arg in "$@" 08:53:11 + case $arg in 08:53:11 + pkg_list+='virtualenv ' 08:53:11 + for arg in "$@" 08:53:11 + case $arg in 08:53:11 + pkg_list+='urllib3~=1.26.15 ' 08:53:11 + [[ -f /tmp/.toxenv ]] 08:53:11 ++ cat /tmp/.toxenv 08:53:11 + lf_venv=/tmp/venv-oQQC 08:53:11 + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oQQC from' file:/tmp/.toxenv 08:53:11 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oQQC from file:/tmp/.toxenv 08:53:11 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 08:53:11 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:53:11 + local 'pip_opts=--upgrade --quiet' 08:53:11 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 08:53:11 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 08:53:11 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 08:53:11 + [[ -n '' ]] 08:53:11 + [[ -n '' ]] 08:53:11 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 08:53:11 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:53:11 + /tmp/venv-oQQC/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 08:53:12 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 08:53:12 lf-activate-venv(): INFO: Base packages installed successfully 08:53:12 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 08:53:12 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 08:53:12 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 08:53:12 + /tmp/venv-oQQC/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 08:53:13 + type python3 08:53:13 + true 08:53:13 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-oQQC/bin to PATH' 08:53:13 lf-activate-venv(): INFO: Adding /tmp/venv-oQQC/bin to PATH 08:53:13 + PATH=/tmp/venv-oQQC/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 08:53:13 + return 0 08:53:13 + [[ -d /opt/pyenv ]] 08:53:13 + echo '---> Setting up pyenv' 08:53:13 ---> Setting up pyenv 08:53:13 + export PYENV_ROOT=/opt/pyenv 08:53:13 + PYENV_ROOT=/opt/pyenv 08:53:13 + export PATH=/opt/pyenv/bin:/tmp/venv-oQQC/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 08:53:13 + PATH=/opt/pyenv/bin:/tmp/venv-oQQC/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 08:53:13 ++ pwd 08:53:13 + PYTHONPATH=/w/workspace/transportpce-tox-verify-transportpce-master 08:53:13 + export PYTHONPATH 08:53:13 + export TOX_TESTENV_PASSENV=PYTHONPATH 08:53:13 + TOX_TESTENV_PASSENV=PYTHONPATH 08:53:13 + tox --version 08:53:13 4.55.1 from /tmp/venv-oQQC/lib/python3.11/site-packages/tox/__init__.py 08:53:13 + PARALLEL=True 08:53:13 + TOX_OPTIONS_LIST= 08:53:13 + [[ -n '' ]] 08:53:13 + case ${PARALLEL,,} in 08:53:13 + TOX_OPTIONS_LIST=' --parallel auto --parallel-live' 08:53:13 + tox --parallel auto --parallel-live 08:53:13 + tee -a /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tox.log 08:53:14 checkbashisms: freeze> python -m pip freeze --all 08:53:14 docs-linkcheck: install_deps> python -I -m pip install -r docs/requirements.txt 08:53:15 docs: install_deps> python -I -m pip install -r docs/requirements.txt 08:53:15 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 08:53:15 checkbashisms: pip==26.1.2,setuptools==82.0.1 08:53:15 checkbashisms: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 08:53:15 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)' 08:53:15 checkbashisms: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find . -not -path '*/\.*' -name '*.sh' -exec checkbashisms -f '{}' + 08:53:16 checkbashisms: OK ✔ in 3.1 seconds 08:53:16 pre-commit: install_deps> python -I -m pip install pre-commit 08:53:19 pre-commit: freeze> python -m pip freeze --all 08:53:19 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 08:53:19 pre-commit: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 08:53:19 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)' 08:53:19 /usr/bin/cpan 08:53:19 pre-commit: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run --all-files --show-diff-on-failure 08:53:19 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 08:53:20 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. 08:53:21 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. 08:53:21 buildcontroller: freeze> python -m pip freeze --all 08:53:22 buildcontroller: 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 08:53:22 buildcontroller: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_controller.sh 08:53:22 + update-java-alternatives -l 08:53:22 [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. 08:53:22 java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64 08:53:22 java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64 08:53:22 java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 08:53:22 + sudo update-java-alternatives -s java-1.21.0-openjdk-amd64 08:53:22 update-alternatives: error: no alternatives for jaotc 08:53:22 update-alternatives: error: no alternatives for rmic 08:53:22 + sed -n ;s/.* version "\(.*\)\.\(.*\)\..*".*$/\1/p; 08:53:22 + java -version 08:53:22 21 08:53:22 + JAVA_VER=21 08:53:22 + echo 21 08:53:22 + sed -n ;s/javac \(.*\)\.\(.*\)\..*.*$/\1/p; 08:53:22 + javac -version 08:53:22 [INFO] Initializing environment for https://github.com/hhatto/autopep8. 08:53:22 21 08:53:22 ok, java is 21 or newer 08:53:22 + JAVAC_VER=21 08:53:22 + echo 21 08:53:22 + [ 21 -ge 21 ] 08:53:22 + [ 21 -ge 21 ] 08:53:22 + echo ok, java is 21 or newer 08:53:22 + wget -nv https://dlcdn.apache.org/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz -P /tmp 08:53:22 [INFO] Initializing environment for https://github.com/perltidy/perltidy. 08:53:23 2026-06-19 08:53:23 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] 08:53:23 + sudo mkdir -p /opt 08:53:23 + sudo tar xf /tmp/apache-maven-3.9.16-bin.tar.gz -C /opt 08:53:23 + sudo ln -s /opt/apache-maven-3.9.16 /opt/maven 08:53:23 + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn 08:53:23 + mvn --version 08:53:23 Apache Maven 3.9.16 (2bdd9fddda4b155ebf8000e807eb73fd829a51d5) 08:53:23 Maven home: /opt/maven 08:53:23 Java version: 21.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 08:53:23 Default locale: en, platform encoding: UTF-8 08:53:23 OS name: "linux", version: "5.15.0-174-generic", arch: "amd64", family: "unix" 08:53:23 NOTE: Picked up JDK_JAVA_OPTIONS: 08:53:23 --add-opens=java.base/java.io=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.lang=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.net=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.nio=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.nio.file=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.util=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.util.jar=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.util.stream=ALL-UNNAMED 08:53:23 --add-opens=java.base/java.util.zip=ALL-UNNAMED 08:53:23 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 08:53:23 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 08:53:23 -Xlog:disable 08:53:24 [INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit. 08:53:25 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier. 08:53:25 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier@4.0.0-alpha.8. 08:53:26 [INFO] Initializing environment for https://github.com/adrienverge/yamllint. 08:53:26 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 08:53:26 [INFO] Once installed this environment will be reused. 08:53:26 [INFO] This may take a few minutes... 08:53:33 [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. 08:53:33 [INFO] Once installed this environment will be reused. 08:53:33 [INFO] This may take a few minutes... 08:53:39 [INFO] Installing environment for https://github.com/hhatto/autopep8. 08:53:39 [INFO] Once installed this environment will be reused. 08:53:39 [INFO] This may take a few minutes... 08:53:40 docs: freeze> python -m pip freeze --all 08:53:41 docs: alabaster==1.0.0,attrs==26.1.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.6.17,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 08:53:41 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 08:53:41 docs-linkcheck: freeze> python -m pip freeze --all 08:53:42 docs-linkcheck: alabaster==1.0.0,attrs==26.1.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.6.17,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 08:53:42 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 08:53:44 docs: OK ✔ in 30.41 seconds 08:53:44 pylint: install_deps> python -I -m pip install 'pylint>=2.6.0' 08:53:44 [INFO] Installing environment for https://github.com/perltidy/perltidy. 08:53:44 [INFO] Once installed this environment will be reused. 08:53:44 [INFO] This may take a few minutes... 08:53:48 docs-linkcheck: OK ✔ in 33.65 seconds 08:53:48 pylint: freeze> python -m pip freeze --all 08:53:49 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 08:53:49 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}$' '{}' + 08:53:56 [INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier. 08:53:56 [INFO] Once installed this environment will be reused. 08:53:56 [INFO] This may take a few minutes... 08:54:00 [INFO] Installing environment for https://github.com/adrienverge/yamllint. 08:54:00 [INFO] Once installed this environment will be reused. 08:54:00 [INFO] This may take a few minutes... 08:54:05 trim trailing whitespace.................................................Passed 08:54:05 fix end of files.........................................................Passed 08:54:06 check for added large files..............................................Passed 08:54:06 check for merge conflicts................................................Passed 08:54:06 check for case conflicts.................................................Passed 08:54:07 check json...............................................................Passed 08:54:07 mixed line ending........................................................Passed 08:54:07 Tabs remover.............................................................Passed 08:54:07 autopep8.................................................................Passed 08:54:11 perltidy.................................................................Passed 08:54:12 ShellCheck v0.11.0....................................................... 08:54:15 ------------------------------------ 08:54:15 Your code has been rated at 10.00/10 08:54:15 08:54:16 Passed 08:54:16 prettier.................................................................Passed 08:54:18 yamllint.................................................................Passed 08:54:18 pre-commit: commands[3] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run gitlint-ci --hook-stage manual 08:54:19 [INFO] Installing environment for https://github.com/jorisroovers/gitlint. 08:54:19 [INFO] Once installed this environment will be reused. 08:54:19 [INFO] This may take a few minutes... 08:54:27 gitlint..................................................................Passed 08:55:10 pylint: OK ✔ in 35.17 seconds 08:55:10 pre-commit: OK ✔ in 1 minute 11.13 seconds 08:55:10 buildcontroller: OK ✔ in 1 minute 55.66 seconds 08:55:10 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 08:55:10 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 08:55:10 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 08:55:10 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 08:55:17 build_karaf_tests71: freeze> python -m pip freeze --all 08:55:17 build_karaf_tests200: freeze> python -m pip freeze --all 08:55:17 build_karaf_tests221: freeze> python -m pip freeze --all 08:55:17 build_karaf_tests121: freeze> python -m pip freeze --all 08:55:17 build_karaf_tests71: 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 08:55:17 build_karaf_tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 08:55:17 build karaf in karaf71 with ./karaf71.env 08:55:17 build_karaf_tests200: 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 08:55:17 build_karaf_tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 08:55:17 build karaf in karafoc200 with ./karafoc200.env 08:55:17 build_karaf_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 08:55:17 build_karaf_tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 08:55:17 build karaf in karaf221 with ./karaf221.env 08:55:18 NOTE: Picked up JDK_JAVA_OPTIONS: 08:55:18 --add-opens=java.base/java.io=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.net=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.file=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.jar=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.stream=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.zip=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 08:55:18 -Xlog:disable 08:55:18 NOTE: Picked up JDK_JAVA_OPTIONS: 08:55:18 --add-opens=java.base/java.io=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.net=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.file=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.jar=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.stream=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.zip=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 08:55:18 -Xlog:disable 08:55:18 build_karaf_tests121: 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 08:55:18 build_karaf_tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 08:55:18 build karaf in karaf121 with ./karaf121.env 08:55:18 NOTE: Picked up JDK_JAVA_OPTIONS: 08:55:18 --add-opens=java.base/java.io=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.net=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.file=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.jar=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.stream=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.zip=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 08:55:18 -Xlog:disable 08:55:18 NOTE: Picked up JDK_JAVA_OPTIONS: 08:55:18 --add-opens=java.base/java.io=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.net=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.nio.file=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.jar=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.stream=ALL-UNNAMED 08:55:18 --add-opens=java.base/java.util.zip=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 08:55:18 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 08:55:18 -Xlog:disable 08:56:09 build_karaf_tests200: OK ✔ in 59.48 seconds 08:56:09 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 08:56:11 build_karaf_tests221: OK ✔ in 1 minute 2.01 seconds 08:56:11 build_karaf_tests121: OK ✔ in 1 minute 2.1 seconds 08:56:11 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 08:56:11 build_karaf_tests71: OK ✔ in 1 minute 2.47 seconds 08:56:11 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 08:56:18 buildlighty: freeze> python -m pip freeze --all 08:56:19 buildlighty: 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 08:56:19 buildlighty: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh 08:56:19 NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED 08:56:19 sims: freeze> python -m pip freeze --all 08:56:19 sims: 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 08:56:19 sims: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_lightynode.sh 08:56:19 Using lighynode version 22.1.0.7 08:56:19 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 08:56:22 sims: OK ✔ in 11.37 seconds 08:56:22 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 08:56:29 tests71: freeze> python -m pip freeze --all 08:56:29 tests71: 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 08:56:29 tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 7.1 08:56:29 using environment variables from ./karaf71.env 08:56:29 pytest -q transportpce_tests/7.1/test01_portmapping.py 08:57:07 buildlighty: OK ✔ in 44.98 seconds 08:57:07 testsPCE: freeze> python -m pip freeze --all 08:57:07 testsPCE: bcrypt==5.0.0,certifi==2026.6.17,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 08:57:07 testsPCE: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce 08:57:07 pytest -q transportpce_tests/pce/test01_pce.py 08:57:13 ............ [100%] 08:57:26 12 passed in 57.01s 08:57:26 pytest -q transportpce_tests/7.1/test02_otn_renderer.py 08:58:05 ................................................... [100%] 08:59:11 20 passed in 123.39s (0:02:03) 08:59:11 pytest -q transportpce_tests/pce/test02_pce_400G.py 08:59:12 ........F...F..F.......F........ [100%] 08:59:52 =================================== FAILURES =================================== 08:59:52 ______________ TestTransportPCEPce400g.test_01_load_port_mapping _______________ 08:59:52 08:59:52 self = 08:59:52 08:59:52 def test_01_load_port_mapping(self): 08:59:52 response = test_utils.post_portmapping(self.port_mapping_data) 08:59:52 > self.assertIn(response['status_code'], (requests.codes.created, requests.codes.no_content)) 08:59:52 E AssertionError: 404 not found in (201, 204) 08:59:52 08:59:52 transportpce_tests/pce/test02_pce_400G.py:128: AssertionError 08:59:52 ---------------------------- Captured stdout setup ----------------------------- 08:59:52 sample files content loaded 08:59:52 starting OpenDaylight... 08:59:52 starting KARAF (karaf) TransportPCE build... 08:59:52 Searching for patterns in karaf.log... Pattern found! OpenDaylight started ! 08:59:52 ----------------------------- Captured stdout call ----------------------------- 08:59:52 execution of test_01_load_port_mapping 08:59:52 ________ TestTransportPCEPce400g.test_03_path_computation_400G_xpdr_bi _________ 08:59:52 08:59:52 self = 08:59:52 08:59:52 def test_03_path_computation_400G_xpdr_bi(self): 08:59:52 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 08:59:52 'path-computation-request', 08:59:52 self.path_computation_input_data) 08:59:52 self.assertEqual(response['status_code'], requests.codes.ok) 08:59:52 > self.assertIn('Path is calculated', 08:59:52 response['output']['configuration-response-common']['response-message']) 08:59:52 E AssertionError: 'Path is calculated' not found in 'Error during reading nodes: A is not present in the network' 08:59:52 08:59:52 transportpce_tests/pce/test02_pce_400G.py:154: AssertionError 08:59:52 ----------------------------- Captured stdout call ----------------------------- 08:59:52 execution of test_03_path_computation_400G_xpdr_bi 08:59:52 ________ TestTransportPCEPce400g.test_05_path_computation_OTUC4_xpdr_bi ________ 08:59:52 08:59:52 self = 08:59:52 08:59:52 def test_05_path_computation_OTUC4_xpdr_bi(self): 08:59:52 self.path_computation_input_data["service-name"] = "service-OTUC4" 08:59:52 self.path_computation_input_data["service-a-end"]["service-format"] = "OTU" 08:59:52 self.path_computation_input_data["service-a-end"]["tx-direction"] =\ 08:59:52 {"port": {"port-device-name": "XPDR-A2-XPDR2"}} 08:59:52 self.path_computation_input_data["service-z-end"]["service-format"] = "OTU" 08:59:52 self.path_computation_input_data["service-z-end"]["tx-direction"] =\ 08:59:52 {"port": {"port-device-name": "XPDR-C2-XPDR2"}} 08:59:52 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 08:59:52 'path-computation-request', 08:59:52 self.path_computation_input_data) 08:59:52 self.assertEqual(response['status_code'], requests.codes.ok) 08:59:52 > self.assertIn('Path is calculated', 08:59:52 response['output']['configuration-response-common']['response-message']) 08:59:52 E AssertionError: 'Path is calculated' not found in 'Error during reading nodes: A is not present in the network' 08:59:52 08:59:52 transportpce_tests/pce/test02_pce_400G.py:203: AssertionError 08:59:52 ----------------------------- Captured stdout call ----------------------------- 08:59:52 execution of test_05_path_computation_OTUC4_xpdr_bi 08:59:52 ________ TestTransportPCEPce400g.test_09_path_computation_100G_xpdr_bi _________ 08:59:52 08:59:52 self = 08:59:52 08:59:52 def test_09_path_computation_100G_xpdr_bi(self): 08:59:52 self.path_computation_input_data["service-name"] = "service-100GE" 08:59:52 self.path_computation_input_data["service-a-end"]["service-rate"] = "100" 08:59:52 self.path_computation_input_data["service-a-end"]["service-format"] = "Ethernet" 08:59:52 self.path_computation_input_data["service-a-end"]["tx-direction"] = \ 08:59:52 {"port": {"port-device-name": "XPDR-A2-XPDR2", 08:59:52 "port-name": "XPDR2-CLIENT1"}} 08:59:52 self.path_computation_input_data["service-z-end"]["service-rate"] = "100" 08:59:52 self.path_computation_input_data["service-z-end"]["service-format"] = "Ethernet" 08:59:52 self.path_computation_input_data["service-z-end"]["tx-direction"] = \ 08:59:52 {"port": {"port-device-name": "XPDR-C2-XPDR2", 08:59:52 "port-name": "XPDR2-CLIENT1"}} 08:59:52 self.path_computation_input_data["service-z-end"]["service-format"] = "ODU" 08:59:52 response = test_utils.transportpce_api_rpc_request('transportpce-pce', 08:59:52 'path-computation-request', 08:59:52 self.path_computation_input_data) 08:59:52 self.assertEqual(response['status_code'], requests.codes.ok) 08:59:52 > self.assertIn('Path is calculated', 08:59:52 response['output']['configuration-response-common']['response-message']) 08:59:52 E AssertionError: 'Path is calculated' not found in 'Error during reading nodes: A is not present in the network' 08:59:52 08:59:52 transportpce_tests/pce/test02_pce_400G.py:290: AssertionError 08:59:52 ----------------------------- Captured stdout call ----------------------------- 08:59:52 execution of test_09_path_computation_100G_xpdr_bi 08:59:52 =========================== short test summary info ============================ 08:59:52 FAILED transportpce_tests/pce/test02_pce_400G.py::TestTransportPCEPce400g::test_01_load_port_mapping 08:59:52 FAILED transportpce_tests/pce/test02_pce_400G.py::TestTransportPCEPce400g::test_03_path_computation_400G_xpdr_bi 08:59:52 FAILED transportpce_tests/pce/test02_pce_400G.py::TestTransportPCEPce400g::test_05_path_computation_OTUC4_xpdr_bi 08:59:52 FAILED transportpce_tests/pce/test02_pce_400G.py::TestTransportPCEPce400g::test_09_path_computation_100G_xpdr_bi 08:59:52 4 failed, 8 passed in 40.86s 08:59:52 testsPCE: exit 1 (164.79 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce pid=11235 08:59:53 testsPCE: FAIL ✖ in 3 minutes 40.85 seconds 08:59:53 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 08:59:53 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 08:59:53 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 08:59:54 ...tests200: freeze> python -m pip freeze --all 09:00:00 tests121: freeze> python -m pip freeze --all 09:00:00 tests_tapi: freeze> python -m pip freeze --all 09:00:00 .tests200: 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 09:00:00 tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh oc200 09:00:00 using environment variables from ./karafoc200.env 09:00:00 pytest -q transportpce_tests/oc200/test01_portmapping.py 09:00:00 tests121: 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 09:00:00 tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 09:00:00 using environment variables from ./karaf121.env 09:00:00 pytest -q transportpce_tests/1.2.1/test01_portmapping.py 09:00:00 tests_tapi: 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 09:00:00 tests_tapi: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh tapi 09:00:00 using environment variables from ./karaf221.env 09:00:00 pytest -q transportpce_tests/tapi/test01_abstracted_topology.py 09:00:02 .............. [100%] 09:01:22 10 passed in 81.52s (0:01:21) 09:01:22 pytest -q transportpce_tests/oc200/test02_topology.py 09:01:56 ............................................ [100%] 09:02:34 14 passed in 70.97s (0:01:10) 09:02:34 pytest -q transportpce_tests/oc200/test03_renderer.py 09:02:48 ..................... [100%] 09:03:16 62 passed in 349.69s (0:05:49) 09:03:16 pytest -q transportpce_tests/7.1/test03_renderer_or_modes.py 09:03:17 ..... [100%] 09:03:23 16 passed in 49.02s 09:03:32 ..................F.FF.F.FF.FF.F.FF.FF.FF.F.FF.FF. [100%] 09:04:32 =================================== FAILURES =================================== 09:04:32 ___________ TestTransportPCEPortmapping.test_02_rdm_device_connected ___________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_02_rdm_device_connected(self): 09:04:32 > response = test_utils.check_device_connection("ROADMA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:54: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:409: in check_device_connection 09:04:32 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_02_rdm_device_connected 09:04:32 ___________ TestTransportPCEPortmapping.test_03_rdm_portmapping_info ___________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_03_rdm_portmapping_info(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:60: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_03_rdm_portmapping_info 09:04:32 ______ TestTransportPCEPortmapping.test_04_rdm_portmapping_DEG1_TTP_TXRX _______ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_04_rdm_portmapping_DEG1_TTP_TXRX(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "DEG1-TTP-TXRX") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:73: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_04_rdm_portmapping_DEG1_TTP_TXRX 09:04:32 ______ TestTransportPCEPortmapping.test_05_rdm_portmapping_SRG1_PP7_TXRX _______ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_05_rdm_portmapping_SRG1_PP7_TXRX(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG1-PP7-TXRX") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:82: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_05_rdm_portmapping_SRG1_PP7_TXRX 09:04:32 ______ TestTransportPCEPortmapping.test_06_rdm_portmapping_SRG3_PP1_TXRX _______ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_06_rdm_portmapping_SRG3_PP1_TXRX(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG3-PP1-TXRX") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:91: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_06_rdm_portmapping_SRG3_PP1_TXRX 09:04:32 __________ TestTransportPCEPortmapping.test_07_xpdr_device_connection __________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'PUT' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 09:04:32 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}}]}' 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'PUT' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_07_xpdr_device_connection(self): 09:04:32 > response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:100: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:381: in mount_device 09:04:32 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:125: in put_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_07_xpdr_device_connection 09:04:32 __________ TestTransportPCEPortmapping.test_08_xpdr_device_connected ___________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_08_xpdr_device_connected(self): 09:04:32 > response = test_utils.check_device_connection("XPDRA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:104: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:409: in check_device_connection 09:04:32 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_08_xpdr_device_connected 09:04:32 __________ TestTransportPCEPortmapping.test_09_xpdr_portmapping_info ___________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_09_xpdr_portmapping_info(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:110: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_09_xpdr_portmapping_info 09:04:32 ________ TestTransportPCEPortmapping.test_10_xpdr_portmapping_NETWORK1 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_10_xpdr_portmapping_NETWORK1(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK1") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:123: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_10_xpdr_portmapping_NETWORK1 09:04:32 ________ TestTransportPCEPortmapping.test_11_xpdr_portmapping_NETWORK2 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_11_xpdr_portmapping_NETWORK2(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK2") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:135: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_11_xpdr_portmapping_NETWORK2 09:04:32 _________ TestTransportPCEPortmapping.test_12_xpdr_portmapping_CLIENT1 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_12_xpdr_portmapping_CLIENT1(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT1") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:147: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_12_xpdr_portmapping_CLIENT1 09:04:32 _________ TestTransportPCEPortmapping.test_13_xpdr_portmapping_CLIENT2 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_13_xpdr_portmapping_CLIENT2(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT2") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:159: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_13_xpdr_portmapping_CLIENT2 09:04:32 _________ TestTransportPCEPortmapping.test_14_xpdr_portmapping_CLIENT3 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_14_xpdr_portmapping_CLIENT3(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT3") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:170: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_14_xpdr_portmapping_CLIENT3 09:04:32 _________ TestTransportPCEPortmapping.test_15_xpdr_portmapping_CLIENT4 _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_15_xpdr_portmapping_CLIENT4(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT4") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:182: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_15_xpdr_portmapping_CLIENT4 09:04:32 ________ TestTransportPCEPortmapping.test_16_xpdr_device_disconnection _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'DELETE' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30 09:04:32 verify = True, cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'DELETE' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_16_xpdr_device_disconnection(self): 09:04:32 > response = test_utils.unmount_device("XPDRA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:193: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:398: in unmount_device 09:04:32 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:134: in delete_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30 09:04:32 verify = True, cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_16_xpdr_device_disconnection 09:04:32 _________ TestTransportPCEPortmapping.test_17_xpdr_device_disconnected _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_17_xpdr_device_disconnected(self): 09:04:32 > response = test_utils.check_device_connection("XPDRA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:197: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:409: in check_device_connection 09:04:32 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_17_xpdr_device_disconnected 09:04:32 ________ TestTransportPCEPortmapping.test_18_xpdr_device_not_connected _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_18_xpdr_device_not_connected(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:205: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_18_xpdr_device_not_connected 09:04:32 _________ TestTransportPCEPortmapping.test_19_rdm_device_disconnection _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'DELETE' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30 09:04:32 verify = True, cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'DELETE' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_19_rdm_device_disconnection(self): 09:04:32 > response = test_utils.unmount_device("ROADMA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:213: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:398: in unmount_device 09:04:32 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:134: in delete_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30 09:04:32 verify = True, cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_19_rdm_device_disconnection 09:04:32 _________ TestTransportPCEPortmapping.test_20_rdm_device_disconnected __________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_20_rdm_device_disconnected(self): 09:04:32 > response = test_utils.check_device_connection("ROADMA01") 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:217: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:409: in check_device_connection 09:04:32 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_20_rdm_device_disconnected 09:04:32 _________ TestTransportPCEPortmapping.test_21_rdm_device_not_connected _________ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 > sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 09:04:32 raise err 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 address = ('localhost', 8191), timeout = 30, source_address = None 09:04:32 socket_options = [(6, 1, 1)] 09:04:32 09:04:32 def create_connection( 09:04:32 address: tuple[str, int], 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 source_address: tuple[str, int] | None = None, 09:04:32 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 09:04:32 ) -> socket.socket: 09:04:32 """Connect to *address* and return the socket object. 09:04:32 09:04:32 Convenience function. Connect to *address* (a 2-tuple ``(host, 09:04:32 port)``) and return the socket object. Passing the optional 09:04:32 *timeout* parameter will set the timeout on the socket instance 09:04:32 before attempting to connect. If no *timeout* is supplied, the 09:04:32 global default timeout setting returned by :func:`socket.getdefaulttimeout` 09:04:32 is used. If *source_address* is set it must be a tuple of (host, port) 09:04:32 for the socket to bind as a source address before making the connection. 09:04:32 An host of '' or port 0 tells the OS to use the default. 09:04:32 """ 09:04:32 09:04:32 host, port = address 09:04:32 if host.startswith("["): 09:04:32 host = host.strip("[]") 09:04:32 err = None 09:04:32 09:04:32 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 09:04:32 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 09:04:32 # The original create_connection function always returns all records. 09:04:32 family = allowed_gai_family() 09:04:32 09:04:32 try: 09:04:32 host.encode("idna") 09:04:32 except UnicodeError: 09:04:32 raise LocationParseError(f"'{host}', label empty or too long") from None 09:04:32 09:04:32 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 09:04:32 af, socktype, proto, canonname, sa = res 09:04:32 sock = None 09:04:32 try: 09:04:32 sock = socket.socket(af, socktype, proto) 09:04:32 09:04:32 # If provided, set socket level options before connecting. 09:04:32 _set_socket_options(sock, socket_options) 09:04:32 09:04:32 if timeout is not _DEFAULT_TIMEOUT: 09:04:32 sock.settimeout(timeout) 09:04:32 if source_address: 09:04:32 sock.bind(source_address) 09:04:32 > sock.connect(sa) 09:04:32 E ConnectionRefusedError: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 09:04:32 body = None 09:04:32 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='} 09:04:32 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 redirect = False, assert_same_host = False 09:04:32 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 09:04:32 release_conn = False, chunked = False, body_pos = None, preload_content = False 09:04:32 decode_content = False, response_kw = {} 09:04:32 09:04:32 def urlopen( # type: ignore[override] 09:04:32 self, 09:04:32 method: str, 09:04:32 url: str, 09:04:32 body: _TYPE_BODY | None = None, 09:04:32 headers: typing.Mapping[str, str] | None = None, 09:04:32 retries: Retry | bool | int | None = None, 09:04:32 redirect: bool = True, 09:04:32 assert_same_host: bool = True, 09:04:32 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 09:04:32 pool_timeout: int | None = None, 09:04:32 release_conn: bool | None = None, 09:04:32 chunked: bool = False, 09:04:32 body_pos: _TYPE_BODY_POSITION | None = None, 09:04:32 preload_content: bool = True, 09:04:32 decode_content: bool = True, 09:04:32 **response_kw: typing.Any, 09:04:32 ) -> BaseHTTPResponse: 09:04:32 """ 09:04:32 Get a connection from the pool and perform an HTTP request. This is the 09:04:32 lowest level call for making a request, so you'll need to specify all 09:04:32 the raw details. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 More commonly, it's appropriate to use a convenience method 09:04:32 such as :meth:`request`. 09:04:32 09:04:32 .. note:: 09:04:32 09:04:32 `release_conn` will only behave as expected if 09:04:32 `preload_content=False` because we want to make 09:04:32 `preload_content=False` the default behaviour someday soon without 09:04:32 breaking backwards compatibility. 09:04:32 09:04:32 :param method: 09:04:32 HTTP request method (such as GET, POST, PUT, etc.) 09:04:32 09:04:32 :param url: 09:04:32 The URL to perform the request on. 09:04:32 09:04:32 :param body: 09:04:32 Data to send in the request body, either :class:`str`, :class:`bytes`, 09:04:32 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 09:04:32 09:04:32 :param headers: 09:04:32 Dictionary of custom headers to send, such as User-Agent, 09:04:32 If-None-Match, etc. If None, pool headers are used. If provided, 09:04:32 these headers completely replace any pool-specific headers. 09:04:32 09:04:32 :param retries: 09:04:32 Configure the number of retries to allow before raising a 09:04:32 :class:`~urllib3.exceptions.MaxRetryError` exception. 09:04:32 09:04:32 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 09:04:32 :class:`~urllib3.util.retry.Retry` object for fine-grained control 09:04:32 over different types of retries. 09:04:32 Pass an integer number to retry connection errors that many times, 09:04:32 but no other types of errors. Pass zero to never retry. 09:04:32 09:04:32 If ``False``, then retries are disabled and any exception is raised 09:04:32 immediately. Also, instead of raising a MaxRetryError on redirects, 09:04:32 the redirect response will be returned. 09:04:32 09:04:32 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 09:04:32 09:04:32 :param redirect: 09:04:32 If True, automatically handle redirects (status codes 301, 302, 09:04:32 303, 307, 308). Each redirect counts as a retry. Disabling retries 09:04:32 will disable redirect, too. 09:04:32 09:04:32 :param assert_same_host: 09:04:32 If ``True``, will make sure that the host of the pool requests is 09:04:32 consistent else will raise HostChangedError. When ``False``, you can 09:04:32 use the pool on an HTTP proxy and request foreign hosts. 09:04:32 09:04:32 :param timeout: 09:04:32 If specified, overrides the default timeout for this one 09:04:32 request. It may be a float (in seconds) or an instance of 09:04:32 :class:`urllib3.util.Timeout`. 09:04:32 09:04:32 :param pool_timeout: 09:04:32 If set and the pool is set to block=True, then this method will 09:04:32 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 09:04:32 connection is available within the time period. 09:04:32 09:04:32 :param bool preload_content: 09:04:32 If True, the response's body will be preloaded into memory. 09:04:32 09:04:32 :param bool decode_content: 09:04:32 If True, will attempt to decode the body based on the 09:04:32 'content-encoding' header. 09:04:32 09:04:32 :param release_conn: 09:04:32 If False, then the urlopen call will not release the connection 09:04:32 back into the pool once a response is received (but will release if 09:04:32 you read the entire contents of the response such as when 09:04:32 `preload_content=True`). This is useful if you're not preloading 09:04:32 the response's content immediately. You will need to call 09:04:32 ``r.release_conn()`` on the response ``r`` to return the connection 09:04:32 back into the pool. If None, it takes the value of ``preload_content`` 09:04:32 which defaults to ``True``. 09:04:32 09:04:32 :param bool chunked: 09:04:32 If True, urllib3 will send the body using chunked transfer 09:04:32 encoding. Otherwise, urllib3 will send the body using the standard 09:04:32 content-length form. Defaults to False. 09:04:32 09:04:32 :param int body_pos: 09:04:32 Position to seek to in file-like body in the event of a retry or 09:04:32 redirect. Typically this won't need to be set because urllib3 will 09:04:32 auto-populate the value when needed. 09:04:32 """ 09:04:32 # Ensure that the URL we're connecting to is properly encoded 09:04:32 if url.startswith("/"): 09:04:32 # URLs starting with / are inherently schemeless. 09:04:32 url = to_str(_encode_target(url)) 09:04:32 destination_scheme = None 09:04:32 else: 09:04:32 parsed_url = parse_url(url) 09:04:32 destination_scheme = parsed_url.scheme 09:04:32 url = to_str(parsed_url.url) 09:04:32 09:04:32 if headers is None: 09:04:32 headers = self.headers 09:04:32 09:04:32 if not isinstance(retries, Retry): 09:04:32 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 09:04:32 09:04:32 if release_conn is None: 09:04:32 release_conn = preload_content 09:04:32 09:04:32 # Check host 09:04:32 if assert_same_host and not self.is_same_host(url): 09:04:32 raise HostChangedError(self, url, retries) 09:04:32 09:04:32 conn = None 09:04:32 09:04:32 # Track whether `conn` needs to be released before 09:04:32 # returning/raising/recursing. Update this variable if necessary, and 09:04:32 # leave `release_conn` constant throughout the function. That way, if 09:04:32 # the function recurses, the original value of `release_conn` will be 09:04:32 # passed down into the recursive call, and its value will be respected. 09:04:32 # 09:04:32 # See issue #651 [1] for details. 09:04:32 # 09:04:32 # [1] 09:04:32 release_this_conn = release_conn 09:04:32 09:04:32 http_tunnel_required = connection_requires_http_tunnel( 09:04:32 self.proxy, self.proxy_config, destination_scheme 09:04:32 ) 09:04:32 09:04:32 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 09:04:32 # have to copy the headers dict so we can safely change it without those 09:04:32 # changes being reflected in anyone else's copy. 09:04:32 if not http_tunnel_required: 09:04:32 headers = headers.copy() # type: ignore[attr-defined] 09:04:32 headers.update(self.proxy_headers) # type: ignore[union-attr] 09:04:32 09:04:32 # Must keep the exception bound to a separate variable or else Python 3 09:04:32 # complains about UnboundLocalError. 09:04:32 err = None 09:04:32 09:04:32 # Keep track of whether we cleanly exited the except block. This 09:04:32 # ensures we do proper cleanup in finally. 09:04:32 clean_exit = False 09:04:32 09:04:32 # Rewind body position, if needed. Record current position 09:04:32 # for future rewinds in the event of a redirect/retry. 09:04:32 body_pos = set_file_position(body, body_pos) 09:04:32 09:04:32 try: 09:04:32 # Request a connection from the queue. 09:04:32 timeout_obj = self._get_timeout(timeout) 09:04:32 conn = self._get_conn(timeout=pool_timeout) 09:04:32 09:04:32 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 09:04:32 09:04:32 # Is this a closed/new connection that requires CONNECT tunnelling? 09:04:32 if self.proxy is not None and http_tunnel_required and conn.is_closed: 09:04:32 try: 09:04:32 self._prepare_proxy(conn) 09:04:32 except (BaseSSLError, OSError, SocketTimeout) as e: 09:04:32 self._raise_timeout( 09:04:32 err=e, url=self.proxy.url, timeout_value=conn.timeout 09:04:32 ) 09:04:32 raise 09:04:32 09:04:32 # If we're going to release the connection in ``finally:``, then 09:04:32 # the response doesn't need to know about the connection. Otherwise 09:04:32 # it will also try to release it and we'll have a double-release 09:04:32 # mess. 09:04:32 response_conn = conn if not release_conn else None 09:04:32 09:04:32 # Make the request on the HTTPConnection object 09:04:32 > response = self._make_request( 09:04:32 conn, 09:04:32 method, 09:04:32 url, 09:04:32 timeout=timeout_obj, 09:04:32 body=body, 09:04:32 headers=headers, 09:04:32 chunked=chunked, 09:04:32 retries=retries, 09:04:32 response_conn=response_conn, 09:04:32 preload_content=preload_content, 09:04:32 decode_content=decode_content, 09:04:32 **response_kw, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:788: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 09:04:32 conn.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 09:04:32 self.endheaders() 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 09:04:32 self._send_output(message_body, encode_chunked=encode_chunked) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 09:04:32 self.send(msg) 09:04:32 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 09:04:32 self.connect() 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 09:04:32 self.sock = self._new_conn() 09:04:32 ^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 09:04:32 def _new_conn(self) -> socket.socket: 09:04:32 """Establish a socket connection and set nodelay settings on it. 09:04:32 09:04:32 :return: New socket connection. 09:04:32 """ 09:04:32 try: 09:04:32 sock = connection.create_connection( 09:04:32 (self._dns_host, self.port), 09:04:32 self.timeout, 09:04:32 source_address=self.source_address, 09:04:32 socket_options=self.socket_options, 09:04:32 ) 09:04:32 except socket.gaierror as e: 09:04:32 raise NameResolutionError(self.host, self, e) from e 09:04:32 except SocketTimeout as e: 09:04:32 raise ConnectTimeoutError( 09:04:32 self, 09:04:32 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 09:04:32 ) from e 09:04:32 09:04:32 except OSError as e: 09:04:32 > raise NewConnectionError( 09:04:32 self, f"Failed to establish a new connection: {e}" 09:04:32 ) from e 09:04:32 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 09:04:32 09:04:32 The above exception was the direct cause of the following exception: 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 > resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:696: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:842: in urlopen 09:04:32 retries = retries.increment( 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 09:04:32 method = 'GET' 09:04:32 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 09:04:32 response = None 09:04:32 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 09:04:32 _pool = 09:04:32 _stacktrace = 09:04:32 09:04:32 def increment( 09:04:32 self, 09:04:32 method: str | None = None, 09:04:32 url: str | None = None, 09:04:32 response: BaseHTTPResponse | None = None, 09:04:32 error: Exception | None = None, 09:04:32 _pool: ConnectionPool | None = None, 09:04:32 _stacktrace: TracebackType | None = None, 09:04:32 ) -> Self: 09:04:32 """Return a new Retry object with incremented retry counters. 09:04:32 09:04:32 :param response: A response object, or None, if the server did not 09:04:32 return a response. 09:04:32 :type response: :class:`~urllib3.response.BaseHTTPResponse` 09:04:32 :param Exception error: An error encountered during the request, or 09:04:32 None if the response was received successfully. 09:04:32 09:04:32 :return: A new ``Retry`` object. 09:04:32 """ 09:04:32 if self.total is False and error: 09:04:32 # Disabled, indicate to re-raise the error. 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 09:04:32 total = self.total 09:04:32 if total is not None: 09:04:32 total -= 1 09:04:32 09:04:32 connect = self.connect 09:04:32 read = self.read 09:04:32 redirect = self.redirect 09:04:32 status_count = self.status 09:04:32 other = self.other 09:04:32 cause = "unknown" 09:04:32 status = None 09:04:32 redirect_location = None 09:04:32 09:04:32 if error and self._is_connection_error(error): 09:04:32 # Connect retry? 09:04:32 if connect is False: 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif connect is not None: 09:04:32 connect -= 1 09:04:32 09:04:32 elif error and self._is_read_error(error): 09:04:32 # Read retry? 09:04:32 if read is False or method is None or not self._is_method_retryable(method): 09:04:32 raise reraise(type(error), error, _stacktrace) 09:04:32 elif read is not None: 09:04:32 read -= 1 09:04:32 09:04:32 elif error: 09:04:32 # Other retry? 09:04:32 if other is not None: 09:04:32 other -= 1 09:04:32 09:04:32 elif response and response.get_redirect_location(): 09:04:32 # Redirect retry? 09:04:32 if redirect is not None: 09:04:32 redirect -= 1 09:04:32 cause = "too many redirects" 09:04:32 response_redirect_location = response.get_redirect_location() 09:04:32 if response_redirect_location: 09:04:32 redirect_location = response_redirect_location 09:04:32 status = response.status 09:04:32 09:04:32 else: 09:04:32 # Incrementing because of a server error like a 500 in 09:04:32 # status_forcelist and the given method is in the allowed_methods 09:04:32 cause = ResponseError.GENERIC_ERROR 09:04:32 if response and response.status: 09:04:32 if status_count is not None: 09:04:32 status_count -= 1 09:04:32 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 09:04:32 status = response.status 09:04:32 09:04:32 history = self.history + ( 09:04:32 RequestHistory(method, url, error, status, redirect_location), 09:04:32 ) 09:04:32 09:04:32 new_retry = self.new( 09:04:32 total=total, 09:04:32 connect=connect, 09:04:32 read=read, 09:04:32 redirect=redirect, 09:04:32 status=status_count, 09:04:32 other=other, 09:04:32 history=history, 09:04:32 ) 09:04:32 09:04:32 if new_retry.is_exhausted(): 09:04:32 reason = error or ResponseError(cause) 09:04:32 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:543: MaxRetryError 09:04:32 09:04:32 During handling of the above exception, another exception occurred: 09:04:32 09:04:32 self = 09:04:32 09:04:32 def test_21_rdm_device_not_connected(self): 09:04:32 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 09:04:32 transportpce_tests/1.2.1/test01_portmapping.py:225: 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 09:04:32 response = get_request(target_url) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 transportpce_tests/common/test_utils.py:117: in get_request 09:04:32 return requests.request( 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:71: in request 09:04:32 return session.request(method=method, url=url, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:651: in request 09:04:32 resp = self.send(prep, **send_kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:784: in send 09:04:32 r = adapter.send(request, **kwargs) 09:04:32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 09:04:32 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 09:04:32 09:04:32 self = 09:04:32 request = , stream = False, timeout = 30, verify = True 09:04:32 cert = None, proxies = OrderedDict() 09:04:32 09:04:32 def send( 09:04:32 self, 09:04:32 request: PreparedRequest, 09:04:32 stream: bool = False, 09:04:32 timeout: _t.TimeoutType = None, 09:04:32 verify: _t.VerifyType = True, 09:04:32 cert: _t.CertType = None, 09:04:32 proxies: dict[str, str] | None = None, 09:04:32 ) -> Response: 09:04:32 """Sends PreparedRequest object. Returns Response object. 09:04:32 09:04:32 :param request: The :class:`PreparedRequest ` being sent. 09:04:32 :param stream: (optional) Whether to stream the request content. 09:04:32 :param timeout: (optional) How long to wait for the server to send 09:04:32 data before giving up, as a float, or a :ref:`(connect timeout, 09:04:32 read timeout) ` tuple. 09:04:32 :type timeout: float or tuple or urllib3 Timeout object 09:04:32 :param verify: (optional) Either a boolean, in which case it controls whether 09:04:32 we verify the server's TLS certificate, or a string, in which case it 09:04:32 must be a path to a CA bundle to use 09:04:32 :param cert: (optional) Any user-provided SSL certificate to be trusted. 09:04:32 :param proxies: (optional) The proxies dictionary to apply to the request. 09:04:32 :rtype: requests.Response 09:04:32 """ 09:04:32 09:04:32 assert _is_prepared(request) 09:04:32 09:04:32 try: 09:04:32 conn = self.get_connection_with_tls_context( 09:04:32 request, verify, proxies=proxies, cert=cert 09:04:32 ) 09:04:32 except LocationValueError as e: 09:04:32 raise InvalidURL(e, request=request) 09:04:32 09:04:32 self.cert_verify(conn, request.url, verify, cert) 09:04:32 url = self.request_url(request, proxies) 09:04:32 self.add_headers( 09:04:32 request, 09:04:32 stream=stream, 09:04:32 timeout=timeout, 09:04:32 verify=verify, 09:04:32 cert=cert, 09:04:32 proxies=proxies, 09:04:32 ) 09:04:32 09:04:32 chunked = not (request.body is None or "Content-Length" in request.headers) 09:04:32 09:04:32 if isinstance(timeout, tuple): 09:04:32 try: 09:04:32 connect, read = timeout 09:04:32 resolved_timeout = TimeoutSauce(connect=connect, read=read) 09:04:32 except ValueError: 09:04:32 raise ValueError( 09:04:32 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 09:04:32 f"or a single float to set both timeouts to the same value." 09:04:32 ) 09:04:32 elif isinstance(timeout, TimeoutSauce): 09:04:32 resolved_timeout = timeout 09:04:32 else: 09:04:32 resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) 09:04:32 09:04:32 try: 09:04:32 resp = conn.urlopen( 09:04:32 method=request.method, 09:04:32 url=url, 09:04:32 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] 09:04:32 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 09:04:32 redirect=False, 09:04:32 assert_same_host=False, 09:04:32 preload_content=False, 09:04:32 decode_content=False, 09:04:32 retries=self.max_retries, 09:04:32 timeout=resolved_timeout, 09:04:32 chunked=chunked, 09:04:32 ) 09:04:32 09:04:32 except (ProtocolError, OSError) as err: 09:04:32 raise ConnectionError(err, request=request) 09:04:32 09:04:32 except MaxRetryError as e: 09:04:32 if isinstance(e.reason, ConnectTimeoutError): 09:04:32 # TODO: Remove this in 3.0.0: see #2811 09:04:32 if not isinstance(e.reason, NewConnectionError): 09:04:32 raise ConnectTimeout(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, ResponseError): 09:04:32 raise RetryError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _ProxyError): 09:04:32 raise ProxyError(e, request=request) 09:04:32 09:04:32 if isinstance(e.reason, _SSLError): 09:04:32 # This branch is for urllib3 v1.22 and later. 09:04:32 raise SSLError(e, request=request) 09:04:32 09:04:32 > raise ConnectionError(e, request=request) 09:04:32 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")) 09:04:32 09:04:32 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:729: ConnectionError 09:04:32 ----------------------------- Captured stdout call ----------------------------- 09:04:32 execution of test_21_rdm_device_not_connected 09:04:32 --------------------------- Captured stdout teardown --------------------------- 09:04:32 all processes killed 09:04:32 ODL log file stored 09:04:32 =========================== short test summary info ============================ 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_02_rdm_device_connected 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_03_rdm_portmapping_info 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_04_rdm_portmapping_DEG1_TTP_TXRX 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_05_rdm_portmapping_SRG1_PP7_TXRX 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_06_rdm_portmapping_SRG3_PP1_TXRX 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_07_xpdr_device_connection 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_08_xpdr_device_connected 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_09_xpdr_portmapping_info 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_10_xpdr_portmapping_NETWORK1 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_11_xpdr_portmapping_NETWORK2 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_12_xpdr_portmapping_CLIENT1 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_13_xpdr_portmapping_CLIENT2 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_14_xpdr_portmapping_CLIENT3 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_15_xpdr_portmapping_CLIENT4 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_16_xpdr_device_disconnection 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_17_xpdr_device_disconnected 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_18_xpdr_device_not_connected 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_19_rdm_device_disconnection 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_20_rdm_device_disconnected 09:04:32 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_21_rdm_device_not_connected 09:04:32 20 failed, 1 passed in 271.80s (0:04:31) 09:04:33 tests200: OK ✔ in 3 minutes 30.74 seconds 09:04:33 tests121: exit 1 (272.18 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 pid=13549 09:04:35 ............................. [100%] 09:05:35 48 passed in 138.35s (0:02:18) 09:05:35 pytest -q transportpce_tests/7.1/test04_renderer_regen_mode.py 09:06:03 ...................... [100%] 09:06:50 22 passed in 74.88s (0:01:14) 09:06:57 .... [100%] 09:11:11 51 passed in 670.60s (0:11:10) 09:11:11 pytest -q transportpce_tests/tapi/test02_full_topology.py 09:12:05 .................................... [100%] 09:16:42 36 passed in 330.61s (0:05:30) 09:16:42 pytest -q transportpce_tests/tapi/test03_tapi_device_change_notifications.py 09:17:31 ....................................................................... [100%] 09:22:02 71 passed in 319.51s (0:05:19) 09:22:02 pytest -q transportpce_tests/tapi/test04_topo_extension.py 09:22:54 ................... [100%] 09:24:26 19 passed in 143.42s (0:02:23) 09:24:26 pytest -q transportpce_tests/tapi/test05_pce_tapi.py 09:26:33 ...................... [100%] 09:38:09 22 passed in 823.44s (0:13:43) 09:38:10 tests121: FAIL ✖ in 4 minutes 40.43 seconds 09:38:10 tests71: OK ✔ in 10 minutes 28.03 seconds 09:38:10 tests_tapi: OK ✔ in 38 minutes 17.32 seconds 09:38:10 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 09:38:17 tests221: freeze> python -m pip freeze --all 09:38:17 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 09:38:17 tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 09:38:17 using environment variables from ./karaf221.env 09:38:17 pytest -q transportpce_tests/2.2.1/test01_portmapping.py 09:38:56 ................................... [100%] 09:39:36 35 passed in 78.26s (0:01:18) 09:39:36 pytest -q transportpce_tests/2.2.1/test02_topo_portmapping.py 09:40:09 ...... [100%] 09:40:23 6 passed in 46.77s 09:40:23 pytest -q transportpce_tests/2.2.1/test03_topology.py 09:41:08 ............................................ [100%] 09:42:43 44 passed in 139.76s (0:02:19) 09:42:43 pytest -q transportpce_tests/2.2.1/test04_otn_topology.py 09:43:20 ............ [100%] 09:43:44 12 passed in 60.50s (0:01:00) 09:43:44 pytest -q transportpce_tests/2.2.1/test05_flex_grid.py 09:44:11 ................ [100%] 09:45:40 16 passed in 115.64s (0:01:55) 09:45:40 pytest -q transportpce_tests/2.2.1/test06_renderer_service_path_nominal.py 09:46:11 ............................... [100%] 09:46:17 31 passed in 37.38s 09:46:18 pytest -q transportpce_tests/2.2.1/test07_otn_renderer.py 09:46:54 .......................... [100%] 09:47:49 26 passed in 91.60s (0:01:31) 09:47:49 pytest -q transportpce_tests/2.2.1/test08_otn_sh_renderer.py 09:48:26 ...................... [100%] 09:49:30 22 passed in 99.94s (0:01:39) 09:49:30 pytest -q transportpce_tests/2.2.1/test09_olm.py 09:50:12 ........................................ [100%] 09:52:34 40 passed in 184.60s (0:03:04) 09:52:34 pytest -q transportpce_tests/2.2.1/test11_otn_end2end.py 09:53:18 ........................................................................ [ 74%] 09:58:56 ......................... [100%] 10:00:47 97 passed in 491.96s (0:08:11) 10:00:47 pytest -q transportpce_tests/2.2.1/test12_end2end.py 10:01:27 ...................................................... [100%] 10:08:15 54 passed in 448.31s (0:07:28) 10:08:15 pytest -q transportpce_tests/2.2.1/test14_otn_switch_end2end.py 10:09:12 ........................................................................ [ 71%] 10:14:21 ............................. [100%] 10:19:30 101 passed in 674.31s (0:11:14) 10:19:30 pytest -q transportpce_tests/2.2.1/test15_otn_end2end_with_intermediate_switch.py 10:20:25 ........................................................................ [ 67%] 10:26:12 ................................... [100%] 10:29:33 107 passed in 602.63s (0:10:02) 10:29:33 pytest -q transportpce_tests/2.2.1/test16_freq_end2end.py 10:30:16 ............................................. [100%] 10:32:54 45 passed in 201.15s (0:03:21) 10:32:54 tests221: OK ✔ in 54 minutes 44.72 seconds 10:32:54 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 10:33:01 tests_hybrid: freeze> python -m pip freeze --all 10:33:01 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 10:33:01 tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid 10:33:01 using environment variables from ./karaf221.env 10:33:01 pytest -q transportpce_tests/hybrid/test01_device_change_notifications.py 10:33:44 ................................................... [100%] 10:35:32 51 passed in 150.77s (0:02:30) 10:35:32 pytest -q transportpce_tests/hybrid/test02_B100G_end2end.py 10:36:16 ........................................................................ [ 66%] 10:40:37 ..................................... [100%] 10:45:43 109 passed in 611.02s (0:10:11) 10:45:43 pytest -q transportpce_tests/hybrid/test03_autonomous_reroute.py 10:46:33 ..................................................... [100%] 10:53:05 53 passed in 441.75s (0:07:21) 10:53:05 buildcontroller: OK (115.66=setup[8.57]+cmd[107.09] seconds) 10:53:05 sims: OK (11.37=setup[8.45]+cmd[2.92] seconds) 10:53:05 build_karaf_tests121: OK (62.10=setup[8.71]+cmd[53.38] seconds) 10:53:05 testsPCE: FAIL code 1 (220.85=setup[56.05]+cmd[164.79] seconds) 10:53:05 tests121: FAIL code 1 (280.43=setup[8.25]+cmd[272.18] seconds) 10:53:05 build_karaf_tests221: OK (62.00=setup[8.62]+cmd[53.38] seconds) 10:53:05 tests_tapi: OK (2297.32=setup[8.29]+cmd[2289.03] seconds) 10:53:05 tests221: OK (3284.72=setup[7.96]+cmd[3276.76] seconds) 10:53:05 build_karaf_tests71: OK (62.47=setup[8.58]+cmd[53.89] seconds) 10:53:05 tests71: OK (628.03=setup[6.85]+cmd[621.17] seconds) 10:53:05 build_karaf_tests200: OK (59.48=setup[8.59]+cmd[50.89] seconds) 10:53:05 tests200: OK (210.74=setup[8.17]+cmd[202.57] seconds) 10:53:05 tests_hybrid: OK (1211.10=setup[6.71]+cmd[1204.38] seconds) 10:53:05 buildlighty: OK (44.98=setup[10.29]+cmd[34.69] seconds) 10:53:05 docs: OK (30.41=setup[27.59]+cmd[2.82] seconds) 10:53:05 docs-linkcheck: OK (33.65=setup[28.77]+cmd[4.88] seconds) 10:53:05 checkbashisms: OK (3.10=setup[1.87]+cmd[0.00,0.04,1.18] seconds) 10:53:05 pre-commit: OK (71.13=setup[3.02]+cmd[0.01,0.00,58.96,9.14] seconds) 10:53:05 pylint: OK (35.17=setup[4.99]+cmd[30.17] seconds) 10:53:05 evaluation failed :( (7192.19 seconds) 10:53:05 + tox_status=1 10:53:05 + echo '---> Completed tox runs' 10:53:05 ---> Completed tox runs 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/build_karaf_tests121/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=build_karaf_tests121 10:53:05 + cp -r .tox/build_karaf_tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests121 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/build_karaf_tests200/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=build_karaf_tests200 10:53:05 + cp -r .tox/build_karaf_tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests200 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/build_karaf_tests221/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=build_karaf_tests221 10:53:05 + cp -r .tox/build_karaf_tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests221 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/build_karaf_tests71/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=build_karaf_tests71 10:53:05 + cp -r .tox/build_karaf_tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests71 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/buildcontroller/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=buildcontroller 10:53:05 + cp -r .tox/buildcontroller/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildcontroller 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/buildlighty/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=buildlighty 10:53:05 + cp -r .tox/buildlighty/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildlighty 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/checkbashisms/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=checkbashisms 10:53:05 + cp -r .tox/checkbashisms/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/checkbashisms 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/docs-linkcheck/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=docs-linkcheck 10:53:05 + cp -r .tox/docs-linkcheck/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs-linkcheck 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/docs/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=docs 10:53:05 + cp -r .tox/docs/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/pre-commit/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=pre-commit 10:53:05 + cp -r .tox/pre-commit/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pre-commit 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/pylint/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=pylint 10:53:05 + cp -r .tox/pylint/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pylint 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/sims/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=sims 10:53:05 + cp -r .tox/sims/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/tests121/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=tests121 10:53:05 + cp -r .tox/tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests121 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/tests200/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=tests200 10:53:05 + cp -r .tox/tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests200 10:53:05 + for i in .tox/*/log 10:53:05 ++ echo .tox/tests221/log 10:53:05 ++ awk -F/ '{print $2}' 10:53:05 + tox_env=tests221 10:53:05 + cp -r .tox/tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests221 10:53:06 + for i in .tox/*/log 10:53:06 ++ echo .tox/tests71/log 10:53:06 ++ awk -F/ '{print $2}' 10:53:06 + tox_env=tests71 10:53:06 + cp -r .tox/tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests71 10:53:06 + for i in .tox/*/log 10:53:06 ++ echo .tox/testsPCE/log 10:53:06 ++ awk -F/ '{print $2}' 10:53:06 + tox_env=testsPCE 10:53:06 + cp -r .tox/testsPCE/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/testsPCE 10:53:06 + for i in .tox/*/log 10:53:06 ++ awk -F/ '{print $2}' 10:53:06 ++ echo .tox/tests_hybrid/log 10:53:06 + tox_env=tests_hybrid 10:53:06 + cp -r .tox/tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_hybrid 10:53:06 + for i in .tox/*/log 10:53:06 ++ echo .tox/tests_tapi/log 10:53:06 ++ awk -F/ '{print $2}' 10:53:06 + tox_env=tests_tapi 10:53:06 + cp -r .tox/tests_tapi/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_tapi 10:53:06 + DOC_DIR=docs/_build/html 10:53:06 + [[ -d docs/_build/html ]] 10:53:06 + echo '---> Archiving generated docs' 10:53:06 ---> Archiving generated docs 10:53:06 + mv docs/_build/html /w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 10:53:06 + echo '---> tox-run.sh ends' 10:53:06 ---> tox-run.sh ends 10:53:06 + test 1 -eq 0 10:53:06 + exit 1 10:53:06 ++ '[' 1 = 1 ']' 10:53:06 ++ '[' -x /usr/bin/clear_console ']' 10:53:06 ++ /usr/bin/clear_console -q 10:53:06 Build step 'Execute shell' marked build as failure 10:53:06 $ ssh-agent -k 10:53:06 unset SSH_AUTH_SOCK; 10:53:06 unset SSH_AGENT_PID; 10:53:06 echo Agent pid 7299 killed; 10:53:06 [ssh-agent] Stopped. 10:53:06 [PostBuildScript] - [INFO] Executing post build scripts. 10:53:06 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6984089114162408663.sh 10:53:06 ---> sysstat.sh 10:53:07 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6468851453411481429.sh 10:53:07 ---> package-listing.sh 10:53:07 ++ facter osfamily 10:53:07 ++ tr '[:upper:]' '[:lower:]' 10:53:07 + OS_FAMILY=debian 10:53:07 + workspace=/w/workspace/transportpce-tox-verify-transportpce-master 10:53:07 + START_PACKAGES=/tmp/packages_start.txt 10:53:07 + END_PACKAGES=/tmp/packages_end.txt 10:53:07 + DIFF_PACKAGES=/tmp/packages_diff.txt 10:53:07 + PACKAGES=/tmp/packages_start.txt 10:53:07 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 10:53:07 + PACKAGES=/tmp/packages_end.txt 10:53:07 + case "${OS_FAMILY}" in 10:53:07 + dpkg -l 10:53:07 + grep '^ii' 10:53:07 + '[' -f /tmp/packages_start.txt ']' 10:53:07 + '[' -f /tmp/packages_end.txt ']' 10:53:07 + diff /tmp/packages_start.txt /tmp/packages_end.txt 10:53:07 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 10:53:07 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 10:53:07 + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 10:53:07 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins1577544490150478792.sh 10:53:07 ---> capture-instance-metadata.sh 10:53:07 Setup pyenv: 10:53:07 system 10:53:07 3.8.20 10:53:07 3.9.20 10:53:07 3.10.15 10:53:07 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:53:07 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-E43A from file:/tmp/.os_lf_venv 10:53:07 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 10:53:07 lf-activate-venv(): INFO: Attempting to install with network-safe options... 10:53:10 lf-activate-venv(): INFO: Base packages installed successfully 10:53:10 lf-activate-venv(): INFO: Installing additional packages: lftools 10:53:22 lf-activate-venv(): INFO: Adding /tmp/venv-E43A/bin to PATH 10:53:22 INFO: Running in OpenStack, capturing instance metadata 10:53:23 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins8174254866518574968.sh 10:53:23 provisioning config files... 10:53:23 Could not find credentials [logs] for transportpce-tox-verify-transportpce-master #5729 10:53:23 copy managed file [jenkins-log-archives-settings] to file:/w/workspace/transportpce-tox-verify-transportpce-master@tmp/config14574158431593847114tmp 10:53:23 Regular expression run condition: Expression=[^.*logs-s3.*], Label=[odl-logs-s3-cloudfront-index] 10:53:23 Run condition [Regular expression match] enabling perform for step [Provide Configuration files] 10:53:23 provisioning config files... 10:53:23 copy managed file [jenkins-s3-log-ship] to file:/home/jenkins/.aws/credentials 10:53:23 [EnvInject] - Injecting environment variables from a build step. 10:53:23 [EnvInject] - Injecting as environment variables the properties content 10:53:23 SERVER_ID=logs 10:53:23 10:53:23 [EnvInject] - Variables injected successfully. 10:53:23 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins15151522655301123895.sh 10:53:23 ---> create-netrc.sh 10:53:23 WARN: Log server credential not found. 10:53:23 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins16571194390498425602.sh 10:53:23 ---> python-tools-install.sh 10:53:23 Setup pyenv: 10:53:23 system 10:53:23 3.8.20 10:53:23 3.9.20 10:53:23 3.10.15 10:53:23 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:53:23 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-E43A from file:/tmp/.os_lf_venv 10:53:23 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 10:53:23 lf-activate-venv(): INFO: Attempting to install with network-safe options... 10:53:25 lf-activate-venv(): INFO: Base packages installed successfully 10:53:25 lf-activate-venv(): INFO: Installing additional packages: lftools 10:53:34 lf-activate-venv(): INFO: Adding /tmp/venv-E43A/bin to PATH 10:53:34 [transportpce-tox-verify-transportpce-master] $ /bin/sh /tmp/jenkins17399293560422490708.sh 10:53:34 ---> uv-install.sh 10:53:34 uv 0.11.22 is already installed 10:53:34 uvx 0.11.22 (x86_64-unknown-linux-gnu) 10:53:34 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins8122123004356992045.sh 10:53:34 ---> sudo-logs.sh 10:53:34 Archiving 'sudo' log.. 10:53:35 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins8879751579337339035.sh 10:53:35 ---> job-cost.sh 10:53:35 INFO: Activating Python virtual environment... 10:53:35 Setup pyenv: 10:53:35 system 10:53:35 3.8.20 10:53:35 3.9.20 10:53:35 3.10.15 10:53:35 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:53:35 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-E43A from file:/tmp/.os_lf_venv 10:53:35 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 10:53:35 lf-activate-venv(): INFO: Attempting to install with network-safe options... 10:53:37 lf-activate-venv(): INFO: Base packages installed successfully 10:53:37 lf-activate-venv(): INFO: Installing additional packages: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 10:53:43 lf-activate-venv(): INFO: Adding /tmp/venv-E43A/bin to PATH 10:53:43 INFO: No stack-cost file found 10:53:43 INFO: Instance uptime: 66861s 10:53:43 INFO: Fetching instance metadata (attempt 1 of 3)... 10:53:43 DEBUG: URL: http://169.254.169.254/latest/meta-data/instance-type 10:53:43 INFO: Successfully fetched instance metadata 10:53:43 INFO: Instance type: v3-standard-4 10:53:43 INFO: Retrieving pricing info for: v3-standard-4 10:53:43 INFO: Fetching Vexxhost pricing API (attempt 1 of 3)... 10:53:43 DEBUG: URL: https://pricing.vexxhost.net/v1/pricing/v3-standard-4/cost?seconds=66861 10:53:44 INFO: Successfully fetched Vexxhost pricing API 10:53:44 INFO: Retrieved cost: 2.09 10:53:44 INFO: Retrieved resource: v3-standard-4 10:53:44 INFO: Creating archive directory: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost 10:53:44 INFO: Archiving costs to: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost.csv 10:53:44 INFO: Successfully archived job cost data 10:53:44 DEBUG: Cost data: transportpce-tox-verify-transportpce-master,5729,2026-06-19 10:53:44,v3-standard-4,66861,2.09,0.00,FAILURE 10:53:44 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins16414495729234806347.sh 10:53:44 ---> logs-deploy.sh 10:53:44 Setup pyenv: 10:53:44 system 10:53:44 3.8.20 10:53:44 3.9.20 10:53:44 3.10.15 10:53:44 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:53:44 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-E43A from file:/tmp/.os_lf_venv 10:53:44 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 10:53:44 lf-activate-venv(): INFO: Attempting to install with network-safe options... 10:53:46 lf-activate-venv(): INFO: Base packages installed successfully 10:53:46 lf-activate-venv(): INFO: Installing additional packages: lftools urllib3~=1.26.15 10:53:55 lf-activate-venv(): INFO: Adding /tmp/venv-E43A/bin to PATH 10:53:55 WARNING: Nexus logging server not set 10:53:55 INFO: S3 path logs/releng/vex-yul-odl-jenkins-1/transportpce-tox-verify-transportpce-master/5729/ 10:53:55 INFO: archiving logs to S3 10:53:57 ---> uname -a: 10:53:57 Linux prd-ubuntu2204-docker-4c-16g-28425 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux 10:53:57 10:53:57 10:53:57 ---> lscpu: 10:53:57 Architecture: x86_64 10:53:57 CPU op-mode(s): 32-bit, 64-bit 10:53:57 Address sizes: 40 bits physical, 48 bits virtual 10:53:57 Byte Order: Little Endian 10:53:57 CPU(s): 4 10:53:57 On-line CPU(s) list: 0-3 10:53:57 Vendor ID: AuthenticAMD 10:53:57 Model name: AMD EPYC-Rome Processor 10:53:57 CPU family: 23 10:53:57 Model: 49 10:53:57 Thread(s) per core: 1 10:53:57 Core(s) per socket: 1 10:53:57 Socket(s): 4 10:53:57 Stepping: 0 10:53:57 BogoMIPS: 5599.99 10:53:57 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 10:53:57 Virtualization: AMD-V 10:53:57 Hypervisor vendor: KVM 10:53:57 Virtualization type: full 10:53:57 L1d cache: 128 KiB (4 instances) 10:53:57 L1i cache: 128 KiB (4 instances) 10:53:57 L2 cache: 2 MiB (4 instances) 10:53:57 L3 cache: 64 MiB (4 instances) 10:53:57 NUMA node(s): 1 10:53:57 NUMA node0 CPU(s): 0-3 10:53:57 Vulnerability Gather data sampling: Not affected 10:53:57 Vulnerability Indirect target selection: Not affected 10:53:57 Vulnerability Itlb multihit: Not affected 10:53:57 Vulnerability L1tf: Not affected 10:53:57 Vulnerability Mds: Not affected 10:53:57 Vulnerability Meltdown: Not affected 10:53:57 Vulnerability Mmio stale data: Not affected 10:53:57 Vulnerability Reg file data sampling: Not affected 10:53:57 Vulnerability Retbleed: Mitigation; untrained return thunk; SMT disabled 10:53:57 Vulnerability Spec rstack overflow: Mitigation; SMT disabled 10:53:57 Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp 10:53:57 Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization 10:53:57 Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected 10:53:57 Vulnerability Srbds: Not affected 10:53:57 Vulnerability Tsa: Not affected 10:53:57 Vulnerability Tsx async abort: Not affected 10:53:57 Vulnerability Vmscape: Not affected 10:53:57 10:53:57 10:53:57 ---> nproc: 10:53:57 4 10:53:57 10:53:57 10:53:57 ---> df -h: 10:53:57 Filesystem Size Used Avail Use% Mounted on 10:53:57 tmpfs 1.6G 1.1M 1.6G 1% /run 10:53:57 /dev/vda1 78G 18G 60G 24% / 10:53:57 tmpfs 7.9G 0 7.9G 0% /dev/shm 10:53:57 tmpfs 5.0M 0 5.0M 0% /run/lock 10:53:57 /dev/vda15 105M 6.1M 99M 6% /boot/efi 10:53:57 tmpfs 1.6G 4.0K 1.6G 1% /run/user/1001 10:53:57 10:53:57 10:53:57 ---> free -m: 10:53:57 total used free shared buff/cache available 10:53:57 Mem: 15989 706 11971 3 3311 14940 10:53:57 Swap: 1023 1 1022 10:53:57 10:53:57 10:53:57 ---> ip addr: 10:53:57 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 10:53:57 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 10:53:57 inet 127.0.0.1/8 scope host lo 10:53:57 valid_lft forever preferred_lft forever 10:53:57 inet6 ::1/128 scope host 10:53:57 valid_lft forever preferred_lft forever 10:53:57 2: ens3: mtu 1458 qdisc mq state UP group default qlen 1000 10:53:57 link/ether fa:16:3e:65:9c:73 brd ff:ff:ff:ff:ff:ff 10:53:57 altname enp0s3 10:53:57 inet 10.30.171.176/23 metric 100 brd 10.30.171.255 scope global dynamic ens3 10:53:57 valid_lft 19533sec preferred_lft 19533sec 10:53:57 inet6 fe80::f816:3eff:fe65:9c73/64 scope link 10:53:57 valid_lft forever preferred_lft forever 10:53:57 3: docker0: mtu 1458 qdisc noqueue state DOWN group default 10:53:57 link/ether 22:12:6f:1c:02:c5 brd ff:ff:ff:ff:ff:ff 10:53:57 inet 10.250.0.254/24 brd 10.250.0.255 scope global docker0 10:53:57 valid_lft forever preferred_lft forever 10:53:57 inet6 fe80::2012:6fff:fe1c:2c5/64 scope link 10:53:57 valid_lft forever preferred_lft forever 10:53:57 10:53:57 10:53:57 ---> sar -b -r -n DEV: 10:53:57 Linux 5.15.0-174-generic (prd-ubuntu2204-docker-4c-16g-28425) 06/19/26 _x86_64_ (4 CPU) 10:53:57 10:53:57 00:00:01 tps rtps wtps dtps bread/s bwrtn/s bdscd/s 10:53:57 00:10:26 1.91 0.17 1.73 0.01 4.14 23.93 422.26 10:53:57 00:20:04 1.48 0.00 1.48 0.00 0.00 15.23 0.00 10:53:57 00:30:04 1.37 0.00 1.37 0.00 0.00 14.39 0.00 10:53:57 00:40:04 1.34 0.00 1.34 0.00 0.00 14.35 0.00 10:53:57 00:50:04 1.43 0.00 1.43 0.00 0.00 14.99 0.00 10:53:57 01:00:04 1.30 0.00 1.30 0.00 0.00 13.79 0.00 10:53:57 01:10:04 1.39 0.00 1.39 0.00 0.00 14.56 0.00 10:53:57 01:20:04 1.39 0.00 1.39 0.00 0.00 14.15 0.00 10:53:57 01:30:04 1.38 0.00 1.38 0.00 0.00 14.13 0.00 10:53:57 01:40:04 1.37 0.00 1.37 0.00 0.00 14.00 0.00 10:53:57 01:50:04 1.32 0.00 1.32 0.00 0.00 13.47 0.00 10:53:57 02:00:04 1.42 0.00 1.42 0.00 0.00 14.40 0.00 10:53:57 02:10:00 1.28 0.00 1.28 0.00 0.00 12.84 0.00 10:53:57 02:20:00 1.43 0.00 1.43 0.00 0.00 14.55 0.00 10:53:57 02:30:01 1.35 0.00 1.35 0.00 0.00 13.78 0.00 10:53:57 02:40:01 1.37 0.00 1.37 0.00 0.00 14.00 0.00 10:53:57 02:50:01 1.33 0.00 1.33 0.00 0.00 13.54 0.00 10:53:57 03:00:01 1.36 0.00 1.36 0.00 0.00 13.85 0.00 10:53:57 03:10:02 1.36 0.00 1.36 0.00 0.00 14.00 0.00 10:53:57 03:20:01 1.39 0.00 1.39 0.00 0.00 14.05 0.00 10:53:57 03:30:01 1.37 0.00 1.37 0.00 0.00 13.84 0.00 10:53:57 03:40:03 1.39 0.00 1.39 0.00 0.00 14.35 0.43 10:53:57 03:50:01 1.40 0.00 1.40 0.00 0.00 14.22 0.00 10:53:57 04:00:01 1.36 0.00 1.36 0.00 0.00 13.94 0.00 10:53:57 04:10:04 1.43 0.00 1.43 0.00 0.00 14.94 0.05 10:53:57 04:20:01 1.49 0.00 1.49 0.00 0.00 15.28 0.00 10:53:57 04:30:01 1.64 0.00 1.64 0.00 0.00 16.77 0.00 10:53:57 04:40:04 1.57 0.00 1.57 0.00 0.00 16.24 0.00 10:53:57 04:50:01 1.64 0.00 1.64 0.00 0.00 16.53 0.00 10:53:57 05:00:01 1.72 0.00 1.72 0.00 0.00 17.57 0.00 10:53:57 05:10:04 1.80 0.00 1.80 0.00 0.00 18.04 0.00 10:53:57 05:20:01 1.66 0.00 1.66 0.00 0.00 16.67 0.00 10:53:57 05:30:01 1.79 0.00 1.74 0.06 0.00 27.49 468.12 10:53:57 05:40:04 1.74 0.00 1.74 0.00 0.00 17.90 0.00 10:53:57 05:50:01 1.76 0.00 1.76 0.00 0.00 17.98 0.00 10:53:57 06:00:01 1.58 0.00 1.58 0.00 0.00 16.42 0.00 10:53:57 06:10:04 1.45 0.00 1.45 0.00 0.00 14.83 0.00 10:53:57 06:20:01 1.51 0.00 1.51 0.00 0.00 15.40 0.00 10:53:57 06:30:01 1.46 0.01 1.45 0.00 0.09 15.13 0.00 10:53:57 06:40:04 1.47 0.00 1.47 0.00 0.00 14.76 0.00 10:53:57 06:50:01 1.55 0.00 1.55 0.00 0.00 15.70 0.00 10:53:57 07:00:01 1.54 0.00 1.54 0.00 0.00 15.46 0.00 10:53:57 07:10:04 1.50 0.00 1.50 0.00 0.00 15.01 0.00 10:53:57 07:20:01 1.57 0.00 1.57 0.00 0.00 16.02 0.00 10:53:57 07:30:01 1.51 0.00 1.51 0.00 0.00 15.29 0.00 10:53:57 07:40:04 1.53 0.00 1.53 0.00 0.00 15.59 0.00 10:53:57 07:50:01 1.58 0.00 1.58 0.00 0.00 16.03 0.00 10:53:57 08:00:01 1.54 0.00 1.54 0.00 0.00 15.68 0.00 10:53:57 08:10:04 1.53 0.00 1.53 0.00 0.00 15.52 0.00 10:53:57 08:20:01 1.49 0.00 1.49 0.00 0.00 15.29 0.00 10:53:57 08:30:01 1.44 0.00 1.44 0.00 0.00 14.57 0.00 10:53:57 08:40:04 1.52 0.00 1.52 0.00 0.00 15.41 0.00 10:53:57 08:50:01 1.58 0.00 1.58 0.00 0.00 16.15 0.00 10:53:57 09:00:01 201.54 9.53 187.12 4.90 844.92 37504.39 25416.07 10:53:57 09:10:01 37.85 4.44 31.78 1.64 192.35 3713.88 2268.67 10:53:57 09:20:01 12.29 4.22 7.67 0.40 88.66 224.86 1154.92 10:53:57 09:30:01 7.96 0.01 7.59 0.36 0.61 243.48 1299.60 10:53:57 09:40:04 11.48 2.18 8.97 0.33 108.57 466.40 668.45 10:53:57 09:50:04 19.20 0.02 18.41 0.77 0.95 594.08 753.25 10:53:57 10:00:01 5.89 0.00 5.67 0.22 0.28 142.79 189.31 10:53:57 10:10:03 8.06 0.01 7.70 0.35 1.22 249.14 137.72 10:53:57 10:20:04 4.29 0.00 4.18 0.10 0.31 137.93 50.25 10:53:57 10:30:01 6.55 0.01 6.39 0.16 0.19 109.41 44.13 10:53:57 10:40:04 10.22 0.18 9.59 0.45 2.63 658.23 129.91 10:53:57 10:50:04 5.33 0.07 5.09 0.18 2.53 174.88 49.17 10:53:57 Average: 6.30 0.32 5.83 0.15 19.19 692.45 508.43 10:53:57 10:53:57 00:00:01 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 10:53:57 00:10:26 13207820 15518128 485708 2.97 83192 2442760 1151516 6.61 483596 2412568 4 10:53:57 00:20:04 13206816 15517476 486348 2.97 83384 2442904 1151516 6.61 483788 2412944 240 10:53:57 00:30:04 13206340 15517348 486508 2.97 83616 2443036 1151580 6.61 484016 2414388 292 10:53:57 00:40:04 13204856 15516072 487804 2.98 83800 2443048 1151644 6.61 484208 2416144 244 10:53:57 00:50:04 13201412 15512860 490956 3.00 84004 2443060 1151708 6.61 484412 2419472 64 10:53:57 01:00:04 13200660 15512372 491456 3.00 84200 2443144 1151708 6.61 484608 2419584 48 10:53:57 01:10:04 13200156 15512420 491464 3.00 84416 2443476 1151772 6.61 484824 2420172 56 10:53:57 01:20:04 13199652 15512236 491636 3.00 84604 2443608 1151804 6.61 485008 2420312 56 10:53:57 01:30:04 13199652 15512476 491424 3.00 84832 2443620 1151772 6.61 485232 2420196 248 10:53:57 01:40:04 13199652 15512800 491164 3.00 85040 2443732 1151772 6.61 485440 2420320 248 10:53:57 01:50:04 13199652 15512992 490968 3.00 85216 2443740 1151836 6.61 485620 2420612 256 10:53:57 02:00:04 13199428 15512992 490916 3.00 85436 2443752 1151820 6.61 485824 2420564 268 10:53:57 02:10:00 13199428 15513188 490628 3.00 85612 2443760 1151756 6.61 486004 2421084 204 10:53:57 02:20:00 13199208 15513160 490648 3.00 85800 2443772 1151756 6.61 486180 2421084 8 10:53:57 02:30:01 13199220 15513344 490412 3.00 85952 2443780 1151772 6.61 486344 2421116 204 10:53:57 02:40:01 13199432 15514032 489700 2.99 86168 2444000 1151772 6.61 486576 2421592 200 10:53:57 02:50:01 13199428 15514352 489372 2.99 86360 2444136 1151900 6.61 486752 2420804 204 10:53:57 03:00:01 13198452 15513648 490080 2.99 86596 2444144 1151964 6.61 487000 2421292 204 10:53:57 03:10:02 13198084 15513528 490144 2.99 86820 2444156 1151900 6.61 487228 2421660 264 10:53:57 03:20:01 13197524 15513220 490512 3.00 87064 2444168 1151900 6.61 487464 2421020 204 10:53:57 03:30:01 13196668 15512736 490944 3.00 87280 2444300 1153040 6.62 487688 2421740 204 10:53:57 03:40:03 13194432 15510668 493084 3.01 87504 2444312 1151900 6.61 487904 2421804 200 10:53:57 03:50:01 13194180 15510728 492964 3.01 87800 2444324 1151900 6.61 488208 2421200 12 10:53:57 04:00:01 13193676 15510616 493104 3.01 88060 2444460 1151884 6.61 488460 2421500 200 10:53:57 04:10:04 13191816 15509080 494632 3.02 88360 2444472 1151900 6.61 489248 2420724 208 10:53:57 04:20:01 13191668 15509284 494420 3.02 88700 2444480 1151900 6.61 489592 2420692 204 10:53:57 04:30:01 13190776 15509000 494712 3.02 89164 2444616 1151900 6.61 490052 2421272 208 10:53:57 04:40:04 13190336 15508988 494592 3.02 89576 2444624 1151900 6.61 490464 2421060 224 10:53:57 04:50:01 13190120 15509320 494376 3.02 89976 2444764 1151968 6.61 490864 2421576 200 10:53:57 05:00:01 13189928 15509588 494036 3.02 90440 2444776 1152016 6.61 491300 2421824 196 10:53:57 05:10:04 13189424 15509592 494092 3.02 90908 2444784 1151968 6.61 491796 2421472 204 10:53:57 05:20:01 13188168 15508828 494828 3.02 91252 2444920 1151968 6.61 492140 2421600 212 10:53:57 05:30:01 13187704 15509248 494252 3.02 91828 2445188 1152168 6.61 492632 2421976 212 10:53:57 05:40:04 13187480 15509552 494016 3.02 92296 2445204 1152168 6.61 493144 2421748 196 10:53:57 05:50:01 13187480 15510144 493236 3.01 92792 2445336 1152152 6.61 493588 2422204 12 10:53:57 06:00:01 13186472 15509580 493932 3.02 93172 2445344 1152168 6.61 494016 2422220 212 10:53:57 06:10:04 13186248 15509624 493856 3.02 93432 2445352 1152216 6.61 494280 2422316 224 10:53:57 06:20:01 13185240 15508808 494684 3.02 93628 2445364 1152168 6.61 494468 2422260 204 10:53:57 06:30:01 13183980 15507852 495660 3.03 93760 2445528 1152168 6.61 494628 2422604 208 10:53:57 06:40:04 13183624 15507708 495800 3.03 93952 2445536 1152168 6.61 494824 2422460 196 10:53:57 06:50:01 13182328 15506644 496848 3.03 94184 2445548 1152200 6.61 495040 2422672 204 10:53:57 07:00:01 13181572 15506244 497176 3.04 94380 2445684 1152168 6.61 495240 2422332 204 10:53:57 07:10:04 13181068 15505916 497492 3.04 94528 2445692 1152168 6.61 495400 2422968 220 10:53:57 07:20:01 13180592 15505632 497760 3.04 94708 2445700 1152216 6.61 495580 2425536 244 10:53:57 07:30:01 13180128 15505488 497824 3.04 94904 2445840 1152200 6.61 495760 2425584 208 10:53:57 07:40:04 13180128 15505728 497660 3.04 95116 2445848 1152232 6.61 495988 2425808 208 10:53:57 07:50:01 13180128 15505920 497460 3.04 95308 2445860 1153920 6.62 496172 2426576 204 10:53:57 08:00:01 13180128 15506124 497240 3.04 95504 2445868 1152264 6.61 496368 2426216 208 10:53:57 08:10:04 13179876 15506196 497184 3.04 95680 2446004 1152232 6.61 496552 2426020 200 10:53:57 08:20:01 13179372 15505904 497392 3.04 95880 2446012 1152232 6.61 496748 2426204 220 10:53:57 08:30:01 13179372 15506068 497228 3.04 96032 2446024 1152296 6.61 496904 2426300 212 10:53:57 08:40:04 13179372 15506348 496936 3.04 96168 2446164 1152296 6.61 497040 2426236 216 10:53:57 08:50:01 13179372 15506496 496744 3.03 96320 2446160 1152296 6.61 497180 2426392 204 10:53:57 09:00:01 1516036 13415976 2499820 15.27 283756 11326184 3232600 18.56 2449856 11556304 229952 10:53:57 09:10:01 6961184 9017472 6918552 42.26 277460 1854572 7798644 44.76 1572240 7349816 140 10:53:57 09:20:01 9066188 11159540 4781144 29.20 278196 1890812 5572112 31.98 1631436 5205164 540 10:53:57 09:30:01 7592036 9701272 6238480 38.10 278896 1906012 6957712 39.94 1635344 6656964 272 10:53:57 09:40:04 11080884 13318176 2623764 16.02 284176 2028376 3554412 20.40 1655020 3180252 5720 10:53:57 09:50:04 9919288 12238464 3703092 22.62 285068 2109332 5023352 28.83 1671472 4322672 428 10:53:57 10:00:01 8887892 11222924 4717832 28.81 285456 2124808 5440016 31.23 1672200 5340408 200 10:53:57 10:10:03 7607536 9979452 5960788 36.41 286000 2161172 6776172 38.90 1675136 6598184 408 10:53:57 10:20:04 10059940 12453904 3487564 21.30 286204 2183004 4893804 28.09 1678084 4173764 708 10:53:57 10:30:01 10560700 12979080 2962868 18.10 286788 2206836 4302036 24.69 1680404 3673300 21752 10:53:57 10:40:04 8659572 11203616 4737180 28.93 290080 2328484 5292120 30.38 1718860 5526736 464 10:53:57 10:50:04 7783332 10358724 5581672 34.09 290368 2359496 6119492 35.13 1732548 6367636 448 10:53:57 Average: 12289913 14755337 1236258 7.55 125648 2523769 1938769 11.13 719415 3050788 4170 10:53:57 10:53:57 00:00:01 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 10:53:57 00:10:26 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 00:10:26 ens3 0.28 0.09 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 00:10:26 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 00:20:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 00:20:04 ens3 0.18 0.07 0.03 0.02 0.00 0.00 0.00 0.00 10:53:57 00:20:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 00:30:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 00:30:04 ens3 0.60 0.20 0.21 0.11 0.00 0.00 0.00 0.00 10:53:57 00:30:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 00:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 00:40:04 ens3 1.02 0.19 0.23 0.11 0.00 0.00 0.00 0.00 10:53:57 00:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 00:50:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 00:50:04 ens3 3.76 1.14 0.59 2.21 0.00 0.00 0.00 0.00 10:53:57 00:50:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:00:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:00:04 ens3 0.63 0.11 0.09 0.04 0.00 0.00 0.00 0.00 10:53:57 01:00:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:10:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:10:04 ens3 0.67 0.19 0.19 0.11 0.00 0.00 0.00 0.00 10:53:57 01:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:20:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:20:04 ens3 0.50 0.15 0.12 0.07 0.00 0.00 0.00 0.00 10:53:57 01:20:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:30:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:30:04 ens3 0.34 0.10 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 01:30:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:40:04 ens3 0.52 0.19 0.15 0.09 0.00 0.00 0.00 0.00 10:53:57 01:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 01:50:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 01:50:04 ens3 0.36 0.13 0.11 0.06 0.00 0.00 0.00 0.00 10:53:57 01:50:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:00:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:00:04 ens3 2.25 0.25 0.43 0.17 0.00 0.00 0.00 0.00 10:53:57 02:00:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:10:00 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:10:00 ens3 1.50 0.07 0.17 0.01 0.00 0.00 0.00 0.00 10:53:57 02:10:00 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:20:00 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:20:00 ens3 0.40 0.07 0.05 0.02 0.00 0.00 0.00 0.00 10:53:57 02:20:00 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:30:01 lo 0.12 0.12 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:30:01 ens3 0.27 0.09 0.05 0.02 0.00 0.00 0.00 0.00 10:53:57 02:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:40:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:40:01 ens3 0.42 0.13 0.11 0.06 0.00 0.00 0.00 0.00 10:53:57 02:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 02:50:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 02:50:01 ens3 0.43 0.12 0.12 0.06 0.00 0.00 0.00 0.00 10:53:57 02:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:00:01 ens3 0.39 0.17 0.13 0.08 0.00 0.00 0.00 0.00 10:53:57 03:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:10:02 lo 0.12 0.12 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:10:02 ens3 2.17 0.30 0.45 0.19 0.00 0.00 0.00 0.00 10:53:57 03:10:02 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:20:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:20:01 ens3 1.96 0.07 0.22 0.02 0.00 0.00 0.00 0.00 10:53:57 03:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:30:01 ens3 0.50 0.14 0.11 0.06 0.00 0.00 0.00 0.00 10:53:57 03:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:40:03 lo 0.13 0.13 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:40:03 ens3 1.30 0.15 6.17 0.05 0.00 0.00 0.00 0.00 10:53:57 03:40:03 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 03:50:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 03:50:01 ens3 0.26 0.07 0.04 0.02 0.00 0.00 0.00 0.00 10:53:57 03:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:00:01 ens3 0.33 0.13 0.10 0.06 0.00 0.00 0.00 0.00 10:53:57 04:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:10:04 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:10:04 ens3 0.33 0.11 0.06 0.02 0.00 0.00 0.00 0.00 10:53:57 04:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:20:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:20:01 ens3 0.35 0.09 0.42 0.02 0.00 0.00 0.00 0.00 10:53:57 04:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:30:01 ens3 0.23 0.08 0.04 0.02 0.00 0.00 0.00 0.00 10:53:57 04:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:40:04 ens3 0.29 0.12 0.08 0.04 0.00 0.00 0.00 0.00 10:53:57 04:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 04:50:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 04:50:01 ens3 0.34 0.13 0.10 0.06 0.00 0.00 0.00 0.00 10:53:57 04:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:00:01 ens3 0.46 0.18 0.16 0.10 0.00 0.00 0.00 0.00 10:53:57 05:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:10:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:10:04 ens3 0.20 0.08 0.04 0.02 0.00 0.00 0.00 0.00 10:53:57 05:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:20:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:20:01 ens3 0.27 0.10 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 05:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:30:01 ens3 0.27 0.10 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 05:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:40:04 ens3 0.28 0.10 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 05:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 05:50:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 05:50:01 ens3 0.18 0.08 0.04 0.01 0.00 0.00 0.00 0.00 10:53:57 05:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:00:01 ens3 0.23 0.11 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 06:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:10:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:10:04 ens3 0.44 0.16 0.14 0.09 0.00 0.00 0.00 0.00 10:53:57 06:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:20:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:20:01 ens3 0.29 0.11 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 06:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:30:01 ens3 0.26 0.11 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 06:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:40:04 ens3 0.36 0.12 0.11 0.06 0.00 0.00 0.00 0.00 10:53:57 06:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 06:50:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 06:50:01 ens3 0.35 0.15 0.11 0.07 0.00 0.00 0.00 0.00 10:53:57 06:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:00:01 ens3 0.23 0.11 0.06 0.04 0.00 0.00 0.00 0.00 10:53:57 07:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:10:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:10:04 ens3 0.57 0.16 0.13 0.07 0.00 0.00 0.00 0.00 10:53:57 07:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:20:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:20:01 ens3 1.18 1.58 0.16 1.54 0.00 0.00 0.00 0.00 10:53:57 07:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:30:01 ens3 0.56 0.63 0.06 0.74 0.00 0.00 0.00 0.00 10:53:57 07:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:40:04 ens3 0.76 0.72 0.15 0.95 0.00 0.00 0.00 0.00 10:53:57 07:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 07:50:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 07:50:01 ens3 0.35 0.16 0.11 0.07 0.00 0.00 0.00 0.00 10:53:57 07:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:00:01 ens3 0.38 0.16 0.13 0.09 0.00 0.00 0.00 0.00 10:53:57 08:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:10:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:10:04 ens3 0.50 0.17 0.16 0.09 0.00 0.00 0.00 0.00 10:53:57 08:10:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:20:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:20:01 ens3 0.39 0.14 0.11 0.07 0.00 0.00 0.00 0.00 10:53:57 08:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:30:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:30:01 ens3 0.36 0.13 0.10 0.06 0.00 0.00 0.00 0.00 10:53:57 08:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:40:04 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:40:04 ens3 0.30 0.11 0.07 0.04 0.00 0.00 0.00 0.00 10:53:57 08:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 08:50:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 10:53:57 08:50:01 ens3 0.20 0.10 0.04 0.02 0.00 0.00 0.00 0.00 10:53:57 08:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:00:01 lo 8.33 8.33 5.46 5.46 0.00 0.00 0.00 0.00 10:53:57 09:00:01 ens3 157.18 118.96 2025.98 16.82 0.00 0.00 0.00 0.00 10:53:57 09:00:01 docker0 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:10:01 lo 19.48 19.48 14.98 14.98 0.00 0.00 0.00 0.00 10:53:57 09:10:01 ens3 1.87 1.27 0.70 1.20 0.00 0.00 0.00 0.00 10:53:57 09:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:20:01 lo 12.52 12.52 6.86 6.86 0.00 0.00 0.00 0.00 10:53:57 09:20:01 ens3 0.68 0.50 0.15 0.11 0.00 0.00 0.00 0.00 10:53:57 09:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:30:01 lo 12.46 12.46 7.32 7.32 0.00 0.00 0.00 0.00 10:53:57 09:30:01 ens3 0.50 0.41 0.09 0.08 0.00 0.00 0.00 0.00 10:53:57 09:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:40:04 lo 4.67 4.67 2.09 2.09 0.00 0.00 0.00 0.00 10:53:57 09:40:04 ens3 5.79 4.02 3.79 2.63 0.00 0.00 0.00 0.00 10:53:57 09:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 09:50:04 lo 12.87 12.87 7.25 7.25 0.00 0.00 0.00 0.00 10:53:57 09:50:04 ens3 0.84 0.72 0.16 0.14 0.00 0.00 0.00 0.00 10:53:57 09:50:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:00:01 lo 20.09 20.09 9.71 9.71 0.00 0.00 0.00 0.00 10:53:57 10:00:01 ens3 2.21 2.60 0.40 4.40 0.00 0.00 0.00 0.00 10:53:57 10:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:10:03 lo 28.45 28.45 11.12 11.12 0.00 0.00 0.00 0.00 10:53:57 10:10:03 ens3 0.62 0.52 0.11 0.59 0.00 0.00 0.00 0.00 10:53:57 10:10:03 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:20:04 lo 14.82 14.82 6.32 6.32 0.00 0.00 0.00 0.00 10:53:57 10:20:04 ens3 1.06 0.54 0.33 0.22 0.00 0.00 0.00 0.00 10:53:57 10:20:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:30:01 lo 17.84 17.84 10.52 10.52 0.00 0.00 0.00 0.00 10:53:57 10:30:01 ens3 0.75 0.53 0.19 0.15 0.00 0.00 0.00 0.00 10:53:57 10:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:40:04 lo 19.18 19.18 10.45 10.45 0.00 0.00 0.00 0.00 10:53:57 10:40:04 ens3 1.02 0.86 0.29 0.23 0.00 0.00 0.00 0.00 10:53:57 10:40:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:50:04 lo 28.16 28.16 10.77 10.77 0.00 0.00 0.00 0.00 10:53:57 10:50:04 ens3 0.60 0.48 0.16 0.10 0.00 0.00 0.00 0.00 10:53:57 10:50:04 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 Average: lo 3.14 3.14 1.59 1.59 0.00 0.00 0.00 0.00 10:53:57 Average: ens3 3.15 2.18 31.44 0.54 0.00 0.00 0.00 0.00 10:53:57 Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 10:53:57 10:53:57 10:53:57 ---> sar -P ALL: 10:53:57 Linux 5.15.0-174-generic (prd-ubuntu2204-docker-4c-16g-28425) 06/19/26 _x86_64_ (4 CPU) 10:53:57 10:53:57 00:00:01 CPU %user %nice %system %iowait %steal %idle 10:53:57 00:10:26 all 0.15 0.00 0.03 0.01 0.02 99.79 10:53:57 00:10:26 0 0.03 0.00 0.05 0.00 0.03 99.88 10:53:57 00:10:26 1 0.02 0.00 0.02 0.00 0.01 99.94 10:53:57 00:10:26 2 0.54 0.00 0.03 0.02 0.03 99.39 10:53:57 00:10:26 3 0.02 0.00 0.02 0.01 0.02 99.93 10:53:57 00:20:04 all 0.14 0.00 0.03 0.01 0.02 99.80 10:53:57 00:20:04 0 0.04 0.00 0.03 0.00 0.02 99.91 10:53:57 00:20:04 1 0.03 0.00 0.03 0.00 0.02 99.92 10:53:57 00:20:04 2 0.48 0.00 0.05 0.01 0.03 99.43 10:53:57 00:20:04 3 0.01 0.00 0.02 0.01 0.01 99.95 10:53:57 00:30:04 all 0.13 0.00 0.02 0.01 0.02 99.82 10:53:57 00:30:04 0 0.04 0.00 0.04 0.00 0.03 99.89 10:53:57 00:30:04 1 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 00:30:04 2 0.03 0.00 0.02 0.02 0.02 99.91 10:53:57 00:30:04 3 0.43 0.00 0.02 0.00 0.02 99.52 10:53:57 00:40:04 all 0.09 0.00 0.03 0.01 0.02 99.85 10:53:57 00:40:04 0 0.03 0.00 0.03 0.03 0.01 99.90 10:53:57 00:40:04 1 0.03 0.00 0.03 0.00 0.02 99.92 10:53:57 00:40:04 2 0.02 0.00 0.02 0.03 0.02 99.91 10:53:57 00:40:04 3 0.30 0.00 0.02 0.00 0.03 99.65 10:53:57 00:50:04 all 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 00:50:04 0 0.05 0.00 0.03 0.01 0.01 99.91 10:53:57 00:50:04 1 0.05 0.00 0.04 0.00 0.02 99.89 10:53:57 00:50:04 2 0.02 0.00 0.02 0.01 0.02 99.94 10:53:57 00:50:04 3 0.02 0.00 0.03 0.01 0.02 99.92 10:53:57 01:00:04 all 0.32 0.00 0.03 0.00 0.02 99.64 10:53:57 01:00:04 0 0.04 0.00 0.05 0.01 0.02 99.88 10:53:57 01:00:04 1 0.22 0.00 0.03 0.00 0.01 99.73 10:53:57 01:00:04 2 0.99 0.00 0.02 0.00 0.02 98.96 10:53:57 01:00:04 3 0.01 0.00 0.01 0.00 0.01 99.97 10:53:57 01:10:04 all 0.08 0.00 0.03 0.01 0.01 99.87 10:53:57 01:10:04 0 0.03 0.00 0.04 0.02 0.01 99.90 10:53:57 01:10:04 1 0.02 0.00 0.04 0.00 0.01 99.93 10:53:57 01:10:04 2 0.22 0.00 0.03 0.01 0.02 99.73 10:53:57 01:10:04 3 0.03 0.00 0.02 0.01 0.01 99.93 10:53:57 01:20:04 all 0.36 0.00 0.04 0.01 0.02 99.59 10:53:57 01:20:04 0 0.04 0.00 0.05 0.01 0.02 99.88 10:53:57 01:20:04 1 0.03 0.00 0.02 0.00 0.01 99.94 10:53:57 01:20:04 2 1.32 0.00 0.06 0.01 0.03 98.59 10:53:57 01:20:04 3 0.03 0.00 0.02 0.00 0.01 99.93 10:53:57 01:30:04 all 0.04 0.00 0.03 0.01 0.02 99.91 10:53:57 01:30:04 0 0.03 0.00 0.03 0.01 0.01 99.92 10:53:57 01:30:04 1 0.02 0.00 0.02 0.00 0.01 99.94 10:53:57 01:30:04 2 0.09 0.00 0.02 0.01 0.02 99.86 10:53:57 01:30:04 3 0.03 0.00 0.04 0.00 0.02 99.91 10:53:57 01:40:04 all 0.26 0.00 0.03 0.00 0.02 99.69 10:53:57 01:40:04 0 0.02 0.00 0.02 0.01 0.01 99.93 10:53:57 01:40:04 1 0.03 0.00 0.03 0.01 0.01 99.92 10:53:57 01:40:04 2 0.02 0.00 0.03 0.00 0.03 99.93 10:53:57 01:40:04 3 0.95 0.00 0.03 0.00 0.03 98.99 10:53:57 01:50:04 all 0.08 0.00 0.02 0.01 0.02 99.87 10:53:57 01:50:04 0 0.02 0.00 0.02 0.00 0.01 99.96 10:53:57 01:50:04 1 0.03 0.00 0.02 0.01 0.02 99.92 10:53:57 01:50:04 2 0.04 0.00 0.03 0.01 0.04 99.88 10:53:57 01:50:04 3 0.24 0.00 0.03 0.00 0.03 99.71 10:53:57 10:53:57 01:50:04 CPU %user %nice %system %iowait %steal %idle 10:53:57 02:00:04 all 0.21 0.00 0.03 0.01 0.02 99.74 10:53:57 02:00:04 0 0.01 0.00 0.01 0.01 0.01 99.96 10:53:57 02:00:04 1 0.03 0.00 0.04 0.01 0.02 99.91 10:53:57 02:00:04 2 0.77 0.00 0.04 0.01 0.04 99.14 10:53:57 02:00:04 3 0.02 0.00 0.02 0.00 0.02 99.94 10:53:57 02:10:00 all 0.05 0.00 0.02 0.01 0.02 99.90 10:53:57 02:10:00 0 0.00 0.00 0.01 0.00 0.01 99.98 10:53:57 02:10:00 1 0.03 0.00 0.03 0.00 0.02 99.92 10:53:57 02:10:00 2 0.14 0.00 0.05 0.02 0.05 99.75 10:53:57 02:10:00 3 0.01 0.00 0.01 0.01 0.02 99.95 10:53:57 02:20:00 all 0.11 0.00 0.02 0.01 0.02 99.83 10:53:57 02:20:00 0 0.01 0.00 0.01 0.00 0.00 99.97 10:53:57 02:20:00 1 0.37 0.00 0.02 0.00 0.01 99.59 10:53:57 02:20:00 2 0.04 0.00 0.04 0.01 0.04 99.87 10:53:57 02:20:00 3 0.02 0.00 0.02 0.04 0.02 99.91 10:53:57 02:30:01 all 0.33 0.00 0.03 0.01 0.02 99.62 10:53:57 02:30:01 0 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 02:30:01 1 1.24 0.00 0.02 0.00 0.02 98.72 10:53:57 02:30:01 2 0.03 0.00 0.04 0.01 0.04 99.89 10:53:57 02:30:01 3 0.02 0.00 0.02 0.02 0.01 99.93 10:53:57 02:40:01 all 0.13 0.00 0.02 0.01 0.02 99.83 10:53:57 02:40:01 0 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 02:40:01 1 0.43 0.00 0.02 0.00 0.02 99.52 10:53:57 02:40:01 2 0.03 0.00 0.03 0.01 0.03 99.90 10:53:57 02:40:01 3 0.02 0.00 0.02 0.01 0.02 99.92 10:53:57 02:50:01 all 0.25 0.00 0.02 0.01 0.02 99.70 10:53:57 02:50:01 0 0.03 0.00 0.04 0.00 0.03 99.90 10:53:57 02:50:01 1 0.95 0.00 0.02 0.00 0.01 99.02 10:53:57 02:50:01 2 0.02 0.00 0.01 0.01 0.02 99.94 10:53:57 02:50:01 3 0.02 0.00 0.03 0.02 0.02 99.92 10:53:57 03:00:01 all 0.05 0.00 0.02 0.01 0.02 99.90 10:53:57 03:00:01 0 0.05 0.00 0.04 0.00 0.03 99.89 10:53:57 03:00:01 1 0.11 0.00 0.02 0.00 0.01 99.86 10:53:57 03:00:01 2 0.02 0.00 0.02 0.01 0.02 99.93 10:53:57 03:00:01 3 0.03 0.00 0.02 0.01 0.02 99.92 10:53:57 03:10:02 all 0.06 0.00 0.03 0.01 0.02 99.89 10:53:57 03:10:02 0 0.02 0.00 0.02 0.00 0.02 99.93 10:53:57 03:10:02 1 0.03 0.00 0.03 0.00 0.01 99.93 10:53:57 03:10:02 2 0.16 0.00 0.03 0.01 0.03 99.78 10:53:57 03:10:02 3 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 03:20:01 all 0.04 0.00 0.03 0.01 0.02 99.91 10:53:57 03:20:01 0 0.01 0.00 0.01 0.00 0.01 99.97 10:53:57 03:20:01 1 0.04 0.00 0.03 0.00 0.01 99.91 10:53:57 03:20:01 2 0.09 0.00 0.02 0.00 0.02 99.87 10:53:57 03:20:01 3 0.04 0.00 0.05 0.01 0.03 99.88 10:53:57 03:30:01 all 0.20 0.00 0.03 0.01 0.02 99.75 10:53:57 03:30:01 0 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 03:30:01 1 0.03 0.00 0.03 0.00 0.02 99.92 10:53:57 03:30:01 2 0.73 0.00 0.02 0.01 0.03 99.21 10:53:57 03:30:01 3 0.02 0.00 0.02 0.00 0.02 99.95 10:53:57 03:40:03 all 0.29 0.00 0.03 0.01 0.02 99.66 10:53:57 03:40:03 0 0.03 0.00 0.03 0.00 0.01 99.93 10:53:57 03:40:03 1 1.09 0.00 0.04 0.01 0.03 98.84 10:53:57 03:40:03 2 0.03 0.00 0.03 0.00 0.03 99.91 10:53:57 03:40:03 3 0.01 0.00 0.01 0.01 0.01 99.97 10:53:57 10:53:57 03:40:03 CPU %user %nice %system %iowait %steal %idle 10:53:57 03:50:01 all 0.03 0.00 0.03 0.01 0.02 99.92 10:53:57 03:50:01 0 0.04 0.00 0.05 0.01 0.02 99.88 10:53:57 03:50:01 1 0.02 0.00 0.02 0.01 0.02 99.93 10:53:57 03:50:01 2 0.03 0.00 0.03 0.01 0.03 99.91 10:53:57 03:50:01 3 0.01 0.00 0.01 0.01 0.01 99.96 10:53:57 04:00:01 all 0.20 0.00 0.03 0.00 0.02 99.75 10:53:57 04:00:01 0 0.01 0.00 0.01 0.00 0.01 99.97 10:53:57 04:00:01 1 0.42 0.00 0.04 0.00 0.02 99.53 10:53:57 04:00:01 2 0.05 0.00 0.05 0.00 0.04 99.86 10:53:57 04:00:01 3 0.30 0.00 0.03 0.01 0.01 99.64 10:53:57 04:10:04 all 0.12 0.00 0.03 0.01 0.02 99.83 10:53:57 04:10:04 0 0.04 0.00 0.02 0.00 0.01 99.93 10:53:57 04:10:04 1 0.36 0.00 0.03 0.00 0.02 99.59 10:53:57 04:10:04 2 0.06 0.00 0.04 0.01 0.03 99.86 10:53:57 04:10:04 3 0.01 0.00 0.01 0.01 0.01 99.96 10:53:57 04:20:01 all 0.08 0.00 0.03 0.01 0.02 99.87 10:53:57 04:20:01 0 0.02 0.00 0.03 0.01 0.02 99.93 10:53:57 04:20:01 1 0.02 0.00 0.04 0.00 0.02 99.93 10:53:57 04:20:01 2 0.02 0.00 0.03 0.02 0.02 99.92 10:53:57 04:20:01 3 0.25 0.00 0.02 0.00 0.03 99.70 10:53:57 04:30:01 all 0.05 0.00 0.03 0.01 0.02 99.89 10:53:57 04:30:01 0 0.03 0.00 0.02 0.00 0.01 99.94 10:53:57 04:30:01 1 0.02 0.00 0.03 0.00 0.02 99.93 10:53:57 04:30:01 2 0.02 0.00 0.04 0.01 0.03 99.91 10:53:57 04:30:01 3 0.15 0.00 0.02 0.02 0.03 99.78 10:53:57 04:40:04 all 0.07 0.00 0.02 0.01 0.02 99.88 10:53:57 04:40:04 0 0.01 0.00 0.02 0.00 0.01 99.96 10:53:57 04:40:04 1 0.03 0.00 0.02 0.00 0.02 99.93 10:53:57 04:40:04 2 0.21 0.00 0.03 0.02 0.03 99.71 10:53:57 04:40:04 3 0.02 0.00 0.02 0.00 0.02 99.93 10:53:57 04:50:01 all 0.12 0.00 0.03 0.01 0.02 99.82 10:53:57 04:50:01 0 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 04:50:01 1 0.42 0.00 0.03 0.00 0.02 99.53 10:53:57 04:50:01 2 0.02 0.00 0.02 0.02 0.02 99.92 10:53:57 04:50:01 3 0.03 0.00 0.04 0.01 0.03 99.90 10:53:57 05:00:01 all 0.10 0.00 0.03 0.01 0.02 99.84 10:53:57 05:00:01 0 0.01 0.00 0.01 0.00 0.01 99.97 10:53:57 05:00:01 1 0.35 0.00 0.03 0.01 0.02 99.60 10:53:57 05:00:01 2 0.02 0.00 0.02 0.00 0.02 99.93 10:53:57 05:00:01 3 0.03 0.00 0.05 0.02 0.03 99.88 10:53:57 05:10:04 all 0.04 0.00 0.03 0.01 0.02 99.90 10:53:57 05:10:04 0 0.02 0.00 0.01 0.00 0.01 99.95 10:53:57 05:10:04 1 0.02 0.00 0.02 0.00 0.02 99.94 10:53:57 05:10:04 2 0.02 0.00 0.02 0.02 0.02 99.93 10:53:57 05:10:04 3 0.10 0.00 0.05 0.01 0.04 99.80 10:53:57 05:20:01 all 0.11 0.00 0.03 0.01 0.02 99.82 10:53:57 05:20:01 0 0.02 0.00 0.02 0.01 0.01 99.94 10:53:57 05:20:01 1 0.03 0.00 0.05 0.00 0.03 99.89 10:53:57 05:20:01 2 0.03 0.00 0.03 0.03 0.03 99.89 10:53:57 05:20:01 3 0.36 0.00 0.03 0.01 0.02 99.58 10:53:57 05:30:01 all 0.34 0.00 0.03 0.01 0.02 99.59 10:53:57 05:30:01 0 0.02 0.01 0.03 0.01 0.02 99.91 10:53:57 05:30:01 1 0.03 0.00 0.03 0.02 0.03 99.90 10:53:57 05:30:01 2 0.02 0.00 0.03 0.01 0.02 99.92 10:53:57 05:30:01 3 1.30 0.00 0.02 0.00 0.03 98.64 10:53:57 10:53:57 05:30:01 CPU %user %nice %system %iowait %steal %idle 10:53:57 05:40:04 all 0.24 0.00 0.03 0.01 0.02 99.70 10:53:57 05:40:04 0 0.02 0.00 0.03 0.00 0.01 99.94 10:53:57 05:40:04 1 0.03 0.00 0.02 0.00 0.02 99.93 10:53:57 05:40:04 2 0.03 0.00 0.04 0.00 0.03 99.89 10:53:57 05:40:04 3 0.89 0.00 0.03 0.02 0.03 99.03 10:53:57 05:50:01 all 0.23 0.00 0.03 0.02 0.02 99.70 10:53:57 05:50:01 0 0.02 0.00 0.03 0.01 0.01 99.94 10:53:57 05:50:01 1 0.11 0.00 0.02 0.00 0.01 99.86 10:53:57 05:50:01 2 0.44 0.00 0.05 0.01 0.04 99.47 10:53:57 05:50:01 3 0.34 0.00 0.03 0.07 0.02 99.54 10:53:57 06:00:01 all 0.06 0.00 0.03 0.01 0.02 99.88 10:53:57 06:00:01 0 0.02 0.00 0.01 0.00 0.01 99.96 10:53:57 06:00:01 1 0.17 0.00 0.04 0.02 0.01 99.76 10:53:57 06:00:01 2 0.05 0.00 0.03 0.01 0.03 99.89 10:53:57 06:00:01 3 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 06:10:04 all 0.27 0.00 0.03 0.01 0.02 99.67 10:53:57 06:10:04 0 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 06:10:04 1 1.00 0.00 0.02 0.02 0.01 98.95 10:53:57 06:10:04 2 0.02 0.00 0.03 0.01 0.02 99.92 10:53:57 06:10:04 3 0.04 0.00 0.04 0.00 0.04 99.89 10:53:57 06:20:01 all 0.05 0.00 0.02 0.01 0.02 99.90 10:53:57 06:20:01 0 0.02 0.00 0.02 0.01 0.01 99.95 10:53:57 06:20:01 1 0.12 0.00 0.02 0.02 0.01 99.83 10:53:57 06:20:01 2 0.04 0.00 0.04 0.01 0.03 99.89 10:53:57 06:20:01 3 0.02 0.00 0.02 0.00 0.01 99.94 10:53:57 06:30:01 all 0.03 0.00 0.03 0.01 0.02 99.92 10:53:57 06:30:01 0 0.01 0.00 0.01 0.00 0.01 99.97 10:53:57 06:30:01 1 0.06 0.00 0.05 0.02 0.03 99.86 10:53:57 06:30:01 2 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 06:30:01 3 0.02 0.00 0.03 0.01 0.01 99.94 10:53:57 06:40:04 all 0.20 0.00 0.03 0.00 0.02 99.76 10:53:57 06:40:04 0 0.03 0.00 0.04 0.00 0.01 99.92 10:53:57 06:40:04 1 0.02 0.00 0.02 0.01 0.01 99.94 10:53:57 06:40:04 2 0.03 0.00 0.03 0.00 0.01 99.93 10:53:57 06:40:04 3 0.70 0.00 0.03 0.00 0.03 99.24 10:53:57 06:50:01 all 0.21 0.00 0.03 0.01 0.02 99.73 10:53:57 06:50:01 0 0.02 0.00 0.02 0.01 0.01 99.94 10:53:57 06:50:01 1 0.02 0.00 0.03 0.02 0.01 99.92 10:53:57 06:50:01 2 0.03 0.00 0.03 0.01 0.02 99.93 10:53:57 06:50:01 3 0.76 0.00 0.05 0.02 0.04 99.14 10:53:57 07:00:01 all 0.03 0.00 0.03 0.01 0.01 99.91 10:53:57 07:00:01 0 0.03 0.00 0.03 0.01 0.01 99.93 10:53:57 07:00:01 1 0.02 0.00 0.03 0.01 0.01 99.93 10:53:57 07:00:01 2 0.03 0.00 0.04 0.01 0.02 99.91 10:53:57 07:00:01 3 0.05 0.00 0.03 0.00 0.02 99.90 10:53:57 07:10:04 all 0.15 0.00 0.03 0.01 0.01 99.80 10:53:57 07:10:04 0 0.02 0.00 0.03 0.00 0.01 99.94 10:53:57 07:10:04 1 0.01 0.00 0.02 0.00 0.00 99.96 10:53:57 07:10:04 2 0.10 0.00 0.04 0.02 0.02 99.82 10:53:57 07:10:04 3 0.47 0.00 0.03 0.00 0.02 99.48 10:53:57 07:20:01 all 0.18 0.00 0.04 0.01 0.01 99.76 10:53:57 07:20:01 0 0.05 0.00 0.05 0.00 0.01 99.89 10:53:57 07:20:01 1 0.03 0.00 0.04 0.01 0.01 99.90 10:53:57 07:20:01 2 0.62 0.00 0.03 0.02 0.02 99.32 10:53:57 07:20:01 3 0.01 0.00 0.02 0.01 0.01 99.94 10:53:57 10:53:57 07:20:01 CPU %user %nice %system %iowait %steal %idle 10:53:57 07:30:01 all 0.02 0.00 0.03 0.01 0.02 99.92 10:53:57 07:30:01 0 0.02 0.00 0.01 0.00 0.01 99.96 10:53:57 07:30:01 1 0.03 0.00 0.04 0.02 0.02 99.89 10:53:57 07:30:01 2 0.03 0.00 0.03 0.01 0.02 99.91 10:53:57 07:30:01 3 0.02 0.00 0.03 0.00 0.02 99.92 10:53:57 07:40:04 all 0.10 0.00 0.03 0.01 0.02 99.85 10:53:57 07:40:04 0 0.06 0.00 0.02 0.01 0.01 99.90 10:53:57 07:40:04 1 0.02 0.00 0.02 0.01 0.01 99.94 10:53:57 07:40:04 2 0.29 0.00 0.02 0.01 0.02 99.66 10:53:57 07:40:04 3 0.03 0.00 0.04 0.01 0.03 99.88 10:53:57 07:50:01 all 0.10 0.00 0.03 0.02 0.02 99.83 10:53:57 07:50:01 0 0.01 0.00 0.01 0.03 0.01 99.94 10:53:57 07:50:01 1 0.05 0.00 0.02 0.00 0.01 99.92 10:53:57 07:50:01 2 0.32 0.00 0.06 0.01 0.02 99.59 10:53:57 07:50:01 3 0.03 0.00 0.04 0.04 0.03 99.85 10:53:57 08:00:01 all 0.12 0.00 0.03 0.01 0.02 99.82 10:53:57 08:00:01 0 0.04 0.00 0.04 0.00 0.02 99.91 10:53:57 08:00:01 1 0.04 0.00 0.04 0.00 0.02 99.90 10:53:57 08:00:01 2 0.32 0.00 0.03 0.01 0.02 99.63 10:53:57 08:00:01 3 0.07 0.00 0.03 0.02 0.02 99.86 10:53:57 08:10:04 all 0.15 0.00 0.03 0.01 0.02 99.79 10:53:57 08:10:04 0 0.02 0.00 0.02 0.00 0.01 99.95 10:53:57 08:10:04 1 0.04 0.00 0.04 0.00 0.03 99.89 10:53:57 08:10:04 2 0.02 0.00 0.03 0.00 0.02 99.93 10:53:57 08:10:04 3 0.51 0.00 0.05 0.01 0.02 99.41 10:53:57 08:20:01 all 0.22 0.00 0.03 0.01 0.02 99.73 10:53:57 08:20:01 0 0.01 0.00 0.02 0.00 0.01 99.96 10:53:57 08:20:01 1 0.54 0.00 0.04 0.00 0.03 99.39 10:53:57 08:20:01 2 0.01 0.00 0.02 0.01 0.02 99.94 10:53:57 08:20:01 3 0.30 0.00 0.03 0.02 0.03 99.63 10:53:57 08:30:01 all 0.09 0.00 0.03 0.01 0.02 99.85 10:53:57 08:30:01 0 0.01 0.00 0.01 0.00 0.00 99.98 10:53:57 08:30:01 1 0.30 0.00 0.05 0.00 0.03 99.62 10:53:57 08:30:01 2 0.03 0.00 0.03 0.02 0.02 99.90 10:53:57 08:30:01 3 0.03 0.00 0.04 0.01 0.03 99.90 10:53:57 08:40:04 all 0.12 0.00 0.03 0.04 0.02 99.79 10:53:57 08:40:04 0 0.01 0.00 0.01 0.01 0.01 99.96 10:53:57 08:40:04 1 0.41 0.00 0.03 0.00 0.01 99.55 10:53:57 08:40:04 2 0.04 0.00 0.03 0.14 0.03 99.76 10:53:57 08:40:04 3 0.03 0.00 0.02 0.03 0.02 99.91 10:53:57 08:50:01 all 0.20 0.00 0.03 0.01 0.01 99.75 10:53:57 08:50:01 0 0.01 0.00 0.01 0.01 0.00 99.98 10:53:57 08:50:01 1 0.41 0.00 0.04 0.01 0.02 99.52 10:53:57 08:50:01 2 0.03 0.00 0.03 0.01 0.01 99.92 10:53:57 08:50:01 3 0.34 0.00 0.05 0.01 0.02 99.59 10:53:57 09:00:01 all 43.76 0.00 2.52 0.72 0.09 52.92 10:53:57 09:00:01 0 43.40 0.00 2.58 0.85 0.10 53.07 10:53:57 09:00:01 1 41.15 0.00 2.27 0.28 0.09 56.21 10:53:57 09:00:01 2 47.15 0.00 2.73 0.46 0.09 49.58 10:53:57 09:00:01 3 43.34 0.00 2.50 1.27 0.09 52.81 10:53:57 09:10:01 all 32.92 0.00 1.34 0.06 0.10 65.58 10:53:57 09:10:01 0 33.16 0.00 1.20 0.05 0.10 65.49 10:53:57 09:10:01 1 32.14 0.00 1.47 0.06 0.10 66.23 10:53:57 09:10:01 2 33.56 0.00 1.40 0.10 0.11 64.84 10:53:57 09:10:01 3 32.81 0.00 1.28 0.03 0.10 65.78 10:53:57 10:53:57 09:10:01 CPU %user %nice %system %iowait %steal %idle 10:53:57 09:20:01 all 15.80 0.00 0.65 0.05 0.08 83.42 10:53:57 09:20:01 0 15.40 0.00 0.63 0.03 0.08 83.86 10:53:57 09:20:01 1 15.87 0.00 0.69 0.08 0.08 83.28 10:53:57 09:20:01 2 15.86 0.00 0.63 0.05 0.09 83.38 10:53:57 09:20:01 3 16.08 0.00 0.65 0.05 0.08 83.14 10:53:57 09:30:01 all 17.33 0.00 0.70 0.04 0.09 81.83 10:53:57 09:30:01 0 16.85 0.00 0.76 0.04 0.09 82.26 10:53:57 09:30:01 1 17.35 0.00 0.68 0.04 0.10 81.84 10:53:57 09:30:01 2 17.23 0.00 0.76 0.07 0.10 81.85 10:53:57 09:30:01 3 17.90 0.00 0.60 0.03 0.08 81.38 10:53:57 09:40:04 all 9.41 0.00 0.49 0.08 0.08 89.94 10:53:57 09:40:04 0 8.63 0.00 0.36 0.09 0.07 90.85 10:53:57 09:40:04 1 9.57 0.00 0.56 0.11 0.08 89.67 10:53:57 09:40:04 2 9.35 0.00 0.46 0.04 0.09 90.07 10:53:57 09:40:04 3 10.08 0.00 0.58 0.07 0.07 89.19 10:53:57 09:50:04 all 29.37 0.00 0.94 0.06 0.09 69.54 10:53:57 09:50:04 0 29.31 0.00 0.99 0.04 0.09 69.58 10:53:57 09:50:04 1 28.79 0.00 0.87 0.05 0.09 70.20 10:53:57 09:50:04 2 29.54 0.00 1.02 0.05 0.10 69.31 10:53:57 09:50:04 3 29.84 0.00 0.89 0.11 0.09 69.07 10:53:57 10:00:01 all 10.08 0.00 0.37 0.03 0.08 89.45 10:53:57 10:00:01 0 9.54 0.00 0.33 0.05 0.07 90.00 10:53:57 10:00:01 1 10.07 0.00 0.40 0.01 0.08 89.44 10:53:57 10:00:01 2 10.50 0.00 0.30 0.03 0.08 89.08 10:53:57 10:00:01 3 10.21 0.00 0.44 0.01 0.07 89.26 10:53:57 10:10:03 all 15.38 0.00 0.63 0.03 0.09 83.88 10:53:57 10:10:03 0 15.17 0.00 0.70 0.02 0.08 84.03 10:53:57 10:10:03 1 15.68 0.00 0.55 0.02 0.08 83.67 10:53:57 10:10:03 2 15.12 0.00 0.57 0.02 0.09 84.20 10:53:57 10:10:03 3 15.54 0.00 0.69 0.05 0.08 83.63 10:53:57 10:20:04 all 6.76 0.00 0.37 0.01 0.08 92.78 10:53:57 10:20:04 0 6.56 0.00 0.31 0.00 0.08 93.06 10:53:57 10:20:04 1 6.51 0.00 0.42 0.03 0.08 92.97 10:53:57 10:20:04 2 6.93 0.00 0.39 0.02 0.09 92.58 10:53:57 10:20:04 3 7.03 0.00 0.35 0.01 0.08 92.54 10:53:57 10:30:01 all 9.41 0.00 0.41 0.02 0.08 90.08 10:53:57 10:30:01 0 8.99 0.00 0.34 0.02 0.07 90.58 10:53:57 10:30:01 1 9.56 0.00 0.42 0.04 0.08 89.91 10:53:57 10:30:01 2 9.83 0.00 0.47 0.02 0.08 89.60 10:53:57 10:30:01 3 9.27 0.00 0.41 0.01 0.08 90.24 10:53:57 10:40:04 all 16.96 0.00 0.60 0.04 0.08 82.31 10:53:57 10:40:04 0 16.67 0.00 0.55 0.04 0.08 82.66 10:53:57 10:40:04 1 18.05 0.00 0.73 0.05 0.09 81.08 10:53:57 10:40:04 2 15.88 0.00 0.58 0.06 0.09 83.40 10:53:57 10:40:04 3 17.23 0.00 0.56 0.00 0.08 82.12 10:53:57 10:50:04 all 9.86 0.00 0.49 0.02 0.08 89.54 10:53:57 10:50:04 0 9.72 0.00 0.47 0.00 0.08 89.73 10:53:57 10:50:04 1 9.94 0.00 0.48 0.05 0.08 89.44 10:53:57 10:50:04 2 9.93 0.00 0.50 0.02 0.08 89.47 10:53:57 10:50:04 3 9.86 0.00 0.52 0.01 0.08 89.53 10:53:57 Average: all 3.45 0.00 0.17 0.02 0.03 96.33 10:53:57 Average: 0 3.30 0.00 0.16 0.02 0.03 96.49 10:53:57 Average: 1 3.45 0.00 0.17 0.02 0.03 96.33 10:53:57 Average: 2 3.53 0.00 0.18 0.02 0.04 96.23 10:53:57 Average: 3 3.51 0.00 0.17 0.03 0.03 96.25 10:53:57 10:53:57 10:53:57