06:38:08 Triggered by Gerrit: https://git.opendaylight.org/gerrit/c/transportpce/+/120829 06:38:08 Running as SYSTEM 06:38:08 [EnvInject] - Loading node environment variables. 06:38:08 Building remotely on prd-ubuntu2204-docker-4c-16g-92727 (ubuntu2204-docker-4c-16g) in workspace /w/workspace/transportpce-tox-verify-transportpce-master 06:38:08 [ssh-agent] Looking for ssh-agent implementation... 06:38:09 [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) 06:38:09 $ ssh-agent 06:38:09 SSH_AUTH_SOCK=/tmp/ssh-XXXXXXYkwhb6/agent.3331 06:38:09 SSH_AGENT_PID=3333 06:38:09 [ssh-agent] Started. 06:38:09 Running ssh-add (command line suppressed) 06:38:09 Identity added: /w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_71982299572789730.key (/w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_71982299572789730.key) 06:38:09 [ssh-agent] Using credentials jenkins (jenkins-ssh) 06:38:09 The recommended git tool is: NONE 06:38:10 using credential jenkins-ssh 06:38:10 Wiping out workspace first. 06:38:10 Cloning the remote Git repository 06:38:10 Cloning repository git://devvexx.opendaylight.org/mirror/transportpce 06:38:10 > git init /w/workspace/transportpce-tox-verify-transportpce-master # timeout=10 06:38:11 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 06:38:11 > git --version # timeout=10 06:38:11 > git --version # 'git version 2.34.1' 06:38:11 using GIT_SSH to set credentials jenkins-ssh 06:38:11 Verifying host key using known hosts file, will automatically accept unseen keys 06:38:11 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce +refs/heads/*:refs/remotes/origin/* # timeout=10 06:38:14 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 06:38:14 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 06:38:14 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 06:38:14 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 06:38:14 using GIT_SSH to set credentials jenkins-ssh 06:38:14 Verifying host key using known hosts file, will automatically accept unseen keys 06:38:14 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce refs/changes/29/120829/9 # timeout=10 06:38:15 > git rev-parse 714a98ed800ac38c2078009c0301878166c69189^{commit} # timeout=10 06:38:15 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script 06:38:15 Checking out Revision 714a98ed800ac38c2078009c0301878166c69189 (refs/changes/29/120829/9) 06:38:15 > git config core.sparsecheckout # timeout=10 06:38:15 > git checkout -f 714a98ed800ac38c2078009c0301878166c69189 # timeout=10 06:38:15 Commit message: "Support for openconfig 2.0" 06:38:15 > git rev-parse FETCH_HEAD^{commit} # timeout=10 06:38:15 > git rev-list --no-walk 509d781065379100eb9da8d0414bc0043a05ebc0 # timeout=10 06:38:15 > git remote # timeout=10 06:38:15 > git submodule init # timeout=10 06:38:15 > git submodule sync # timeout=10 06:38:15 > git config --get remote.origin.url # timeout=10 06:38:15 > git submodule init # timeout=10 06:38:15 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 06:38:15 ERROR: No submodules found. 06:38:19 provisioning config files... 06:38:19 copy managed file [npmrc] to file:/home/jenkins/.npmrc 06:38:19 copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf 06:38:19 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins9586928472723635140.sh 06:38:19 ---> python-tools-install.sh 06:38:19 Setup pyenv: 06:38:19 * system (set by /opt/pyenv/version) 06:38:19 * 3.8.20 (set by /opt/pyenv/version) 06:38:19 * 3.9.20 (set by /opt/pyenv/version) 06:38:19 3.10.15 06:38:19 3.11.10 06:38:23 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-TNmL 06:38:23 lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv 06:38:23 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 06:38:23 lf-activate-venv(): INFO: Attempting to install with network-safe options... 06:38:28 lf-activate-venv(): INFO: Base packages installed successfully 06:38:28 lf-activate-venv(): INFO: Installing additional packages: lftools 06:38:56 lf-activate-venv(): INFO: Adding /tmp/venv-TNmL/bin to PATH 06:38:56 Generating Requirements File 06:39:16 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. 06:39:16 httplib2 0.30.2 requires pyparsing<4,>=3.0.4, but you have pyparsing 2.4.7 which is incompatible. 06:39:16 Python 3.11.10 06:39:16 pip 26.0.1 from /tmp/venv-TNmL/lib/python3.11/site-packages/pip (python 3.11) 06:39:17 appdirs==1.4.4 06:39:17 argcomplete==3.6.3 06:39:17 aspy.yaml==1.3.0 06:39:17 attrs==25.4.0 06:39:17 autopage==0.6.0 06:39:17 beautifulsoup4==4.14.3 06:39:17 boto3==1.42.62 06:39:17 botocore==1.42.62 06:39:17 bs4==0.0.2 06:39:17 certifi==2026.2.25 06:39:17 cffi==2.0.0 06:39:17 cfgv==3.5.0 06:39:17 chardet==7.0.1 06:39:17 charset-normalizer==3.4.5 06:39:17 click==8.3.1 06:39:17 cliff==4.13.2 06:39:17 cmd2==3.4.0 06:39:17 cryptography==3.3.2 06:39:17 debtcollector==3.0.0 06:39:17 decorator==5.2.1 06:39:17 defusedxml==0.7.1 06:39:17 Deprecated==1.3.1 06:39:17 distlib==0.4.0 06:39:17 dnspython==2.8.0 06:39:17 docker==7.1.0 06:39:17 dogpile.cache==1.5.0 06:39:17 durationpy==0.10 06:39:17 email-validator==2.3.0 06:39:17 filelock==3.25.0 06:39:17 future==1.0.0 06:39:17 gitdb==4.0.12 06:39:17 GitPython==3.1.46 06:39:17 httplib2==0.30.2 06:39:17 identify==2.6.17 06:39:17 idna==3.11 06:39:17 importlib-resources==1.5.0 06:39:17 iso8601==2.1.0 06:39:17 Jinja2==3.1.6 06:39:17 jmespath==1.1.0 06:39:17 jsonpatch==1.33 06:39:17 jsonpointer==3.0.0 06:39:17 jsonschema==4.26.0 06:39:17 jsonschema-specifications==2025.9.1 06:39:17 keystoneauth1==5.13.1 06:39:17 kubernetes==35.0.0 06:39:17 lftools==0.37.22 06:39:17 lxml==6.0.2 06:39:17 markdown-it-py==4.0.0 06:39:17 MarkupSafe==3.0.3 06:39:17 mdurl==0.1.2 06:39:17 msgpack==1.1.2 06:39:17 multi_key_dict==2.0.3 06:39:17 munch==4.0.0 06:39:17 netaddr==1.3.0 06:39:17 niet==1.4.2 06:39:17 nodeenv==1.10.0 06:39:17 oauth2client==4.1.3 06:39:17 oauthlib==3.3.1 06:39:17 openstacksdk==4.10.0 06:39:17 os-service-types==1.8.2 06:39:17 osc-lib==4.4.0 06:39:17 oslo.config==10.3.0 06:39:17 oslo.context==6.3.0 06:39:17 oslo.i18n==6.7.2 06:39:17 oslo.log==8.1.0 06:39:17 oslo.serialization==5.9.1 06:39:17 oslo.utils==10.0.0 06:39:17 packaging==26.0 06:39:17 pbr==7.0.3 06:39:17 platformdirs==4.9.4 06:39:17 prettytable==3.17.0 06:39:17 psutil==7.2.2 06:39:17 pyasn1==0.6.2 06:39:17 pyasn1_modules==0.4.2 06:39:17 pycparser==3.0 06:39:17 pygerrit2==2.0.15 06:39:17 PyGithub==2.8.1 06:39:17 Pygments==2.19.2 06:39:17 PyJWT==2.11.0 06:39:17 PyNaCl==1.6.2 06:39:17 pyparsing==2.4.7 06:39:17 pyperclip==1.11.0 06:39:17 pyrsistent==0.20.0 06:39:17 python-cinderclient==9.9.0 06:39:17 python-dateutil==2.9.0.post0 06:39:17 python-discovery==1.1.0 06:39:17 python-heatclient==5.1.0 06:39:17 python-jenkins==1.8.3 06:39:17 python-keystoneclient==5.8.0 06:39:17 python-magnumclient==4.10.0 06:39:17 python-openstackclient==9.0.0 06:39:17 python-swiftclient==4.10.0 06:39:17 PyYAML==6.0.3 06:39:17 referencing==0.37.0 06:39:17 requests==2.32.5 06:39:17 requests-oauthlib==2.0.0 06:39:17 requestsexceptions==1.4.0 06:39:17 rfc3986==2.0.0 06:39:17 rich==14.3.3 06:39:17 rich-argparse==1.7.2 06:39:17 rpds-py==0.30.0 06:39:17 rsa==4.9.1 06:39:17 ruamel.yaml==0.19.1 06:39:17 ruamel.yaml.clib==0.2.15 06:39:17 s3transfer==0.16.0 06:39:17 simplejson==3.20.2 06:39:17 six==1.17.0 06:39:17 smmap==5.0.2 06:39:17 soupsieve==2.8.3 06:39:17 stevedore==5.7.0 06:39:17 tabulate==0.10.0 06:39:17 toml==0.10.2 06:39:17 tomlkit==0.14.0 06:39:17 tqdm==4.67.3 06:39:17 typing_extensions==4.15.0 06:39:17 urllib3==1.26.20 06:39:17 virtualenv==21.1.0 06:39:17 wcwidth==0.6.0 06:39:17 websocket-client==1.9.0 06:39:17 wrapt==2.1.2 06:39:17 xdg==6.0.0 06:39:17 xmltodict==1.0.4 06:39:17 yq==3.4.3 06:39:17 [EnvInject] - Injecting environment variables from a build step. 06:39:17 [EnvInject] - Injecting as environment variables the properties content 06:39:17 PYTHON=python3 06:39:17 06:39:17 [EnvInject] - Variables injected successfully. 06:39:17 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins296443205274024269.sh 06:39:17 ---> tox-install.sh 06:39:17 + source /home/jenkins/lf-env.sh 06:39:17 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 06:39:17 ++ mktemp -d /tmp/venv-XXXX 06:39:17 + lf_venv=/tmp/venv-etcE 06:39:17 + local venv_file=/tmp/.os_lf_venv 06:39:17 + local python=python3 06:39:17 + local options 06:39:17 + local set_path=true 06:39:17 + local install_args= 06:39:17 ++ 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 06:39:17 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 06:39:17 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 06:39:17 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 06:39:17 + true 06:39:17 + case $1 in 06:39:17 + venv_file=/tmp/.toxenv 06:39:17 + shift 2 06:39:17 + true 06:39:17 + case $1 in 06:39:17 + shift 06:39:17 + break 06:39:17 + case $python in 06:39:17 + local pkg_list= 06:39:17 + [[ -d /opt/pyenv ]] 06:39:17 + echo 'Setup pyenv:' 06:39:17 Setup pyenv: 06:39:17 + export PYENV_ROOT=/opt/pyenv 06:39:17 + PYENV_ROOT=/opt/pyenv 06:39:17 + export PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:17 + PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:17 + pyenv versions 06:39:17 system 06:39:17 3.8.20 06:39:17 3.9.20 06:39:17 3.10.15 06:39:17 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:39:17 + command -v pyenv 06:39:17 ++ pyenv init - --no-rehash 06:39:17 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 06:39:17 for i in ${!paths[@]}; do 06:39:17 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 06:39:17 fi; done; 06:39:17 echo "${paths[*]}"'\'')" 06:39:17 export PATH="/opt/pyenv/shims:${PATH}" 06:39:17 export PYENV_SHELL=bash 06:39:17 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 06:39:17 pyenv() { 06:39:17 local command 06:39:17 command="${1:-}" 06:39:17 if [ "$#" -gt 0 ]; then 06:39:17 shift 06:39:17 fi 06:39:17 06:39:17 case "$command" in 06:39:17 rehash|shell) 06:39:17 eval "$(pyenv "sh-$command" "$@")" 06:39:17 ;; 06:39:17 *) 06:39:17 command pyenv "$command" "$@" 06:39:17 ;; 06:39:17 esac 06:39:17 }' 06:39:17 +++ bash --norc -ec 'IFS=:; paths=($PATH); 06:39:17 for i in ${!paths[@]}; do 06:39:17 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 06:39:17 fi; done; 06:39:17 echo "${paths[*]}"' 06:39:17 ++ PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:17 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:17 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:17 ++ export PYENV_SHELL=bash 06:39:17 ++ PYENV_SHELL=bash 06:39:17 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 06:39:17 +++ complete -F _pyenv pyenv 06:39:17 ++ lf-pyver python3 06:39:17 ++ local py_version_xy=python3 06:39:17 ++ local py_version_xyz= 06:39:17 ++ pyenv versions 06:39:17 ++ local command 06:39:17 ++ sed 's/^[ *]* //' 06:39:17 ++ command=versions 06:39:17 ++ '[' 1 -gt 0 ']' 06:39:17 ++ shift 06:39:17 ++ case "$command" in 06:39:17 ++ command pyenv versions 06:39:17 ++ awk '{ print $1 }' 06:39:17 ++ grep -E '^[0-9.]*[0-9]$' 06:39:17 ++ [[ ! -s /tmp/.pyenv_versions ]] 06:39:17 +++ grep '^3' /tmp/.pyenv_versions 06:39:17 +++ sort -V 06:39:17 +++ tail -n 1 06:39:17 ++ py_version_xyz=3.11.10 06:39:17 ++ [[ -z 3.11.10 ]] 06:39:17 ++ echo 3.11.10 06:39:17 ++ return 0 06:39:17 + pyenv local 3.11.10 06:39:17 + local command 06:39:17 + command=local 06:39:17 + '[' 2 -gt 0 ']' 06:39:17 + shift 06:39:17 + case "$command" in 06:39:17 + command pyenv local 3.11.10 06:39:17 + for arg in "$@" 06:39:17 + case $arg in 06:39:17 + pkg_list+='tox ' 06:39:17 + for arg in "$@" 06:39:17 + case $arg in 06:39:17 + pkg_list+='virtualenv ' 06:39:17 + for arg in "$@" 06:39:17 + case $arg in 06:39:17 + pkg_list+='urllib3~=1.26.15 ' 06:39:17 + [[ -f /tmp/.toxenv ]] 06:39:17 + [[ ! -f /tmp/.toxenv ]] 06:39:17 + [[ -n '' ]] 06:39:17 + python3 -m venv /tmp/venv-etcE 06:39:21 + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-etcE' 06:39:21 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-etcE 06:39:21 + echo /tmp/venv-etcE 06:39:21 + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' 06:39:21 lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv 06:39:21 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 06:39:21 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 06:39:21 + local 'pip_opts=--upgrade --quiet' 06:39:21 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 06:39:21 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 06:39:21 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 06:39:21 + [[ -n '' ]] 06:39:21 + [[ -n '' ]] 06:39:21 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 06:39:21 lf-activate-venv(): INFO: Attempting to install with network-safe options... 06:39:21 + /tmp/venv-etcE/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 06:39:25 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 06:39:25 lf-activate-venv(): INFO: Base packages installed successfully 06:39:25 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 06:39:25 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 06:39:25 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 06:39:25 + /tmp/venv-etcE/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 06:39:27 + type python3 06:39:27 + true 06:39:27 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-etcE/bin to PATH' 06:39:27 lf-activate-venv(): INFO: Adding /tmp/venv-etcE/bin to PATH 06:39:27 + PATH=/tmp/venv-etcE/bin:/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 06:39:27 + return 0 06:39:27 + python3 --version 06:39:27 Python 3.11.10 06:39:27 + python3 -m pip --version 06:39:27 pip 26.0.1 from /tmp/venv-etcE/lib/python3.11/site-packages/pip (python 3.11) 06:39:27 + python3 -m pip freeze 06:39:27 cachetools==7.0.3 06:39:27 colorama==0.4.6 06:39:27 distlib==0.4.0 06:39:27 filelock==3.25.0 06:39:27 packaging==26.0 06:39:27 platformdirs==4.9.4 06:39:27 pluggy==1.6.0 06:39:27 pyproject-api==1.10.0 06:39:27 python-discovery==1.1.0 06:39:27 tomli_w==1.2.0 06:39:27 tox==4.48.1 06:39:27 urllib3==1.26.20 06:39:27 virtualenv==21.1.0 06:39:28 [transportpce-tox-verify-transportpce-master] $ /bin/sh -xe /tmp/jenkins8673889517259474215.sh 06:39:28 [EnvInject] - Injecting environment variables from a build step. 06:39:28 [EnvInject] - Injecting as environment variables the properties content 06:39:28 PARALLEL=True 06:39:28 06:39:28 [EnvInject] - Variables injected successfully. 06:39:28 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins2161501166944035850.sh 06:39:28 ---> tox-run.sh 06:39:28 + PATH=/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 06:39:28 + ARCHIVE_TOX_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 06:39:28 + ARCHIVE_DOC_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 06:39:28 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 06:39:28 + cd /w/workspace/transportpce-tox-verify-transportpce-master/. 06:39:28 + source /home/jenkins/lf-env.sh 06:39:28 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 06:39:28 ++ mktemp -d /tmp/venv-XXXX 06:39:28 + lf_venv=/tmp/venv-rxlo 06:39:28 + local venv_file=/tmp/.os_lf_venv 06:39:28 + local python=python3 06:39:28 + local options 06:39:28 + local set_path=true 06:39:28 + local install_args= 06:39:28 ++ 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 06:39:28 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 06:39:28 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 06:39:28 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 06:39:28 + true 06:39:28 + case $1 in 06:39:28 + venv_file=/tmp/.toxenv 06:39:28 + shift 2 06:39:28 + true 06:39:28 + case $1 in 06:39:28 + shift 06:39:28 + break 06:39:28 + case $python in 06:39:28 + local pkg_list= 06:39:28 + [[ -d /opt/pyenv ]] 06:39:28 + echo 'Setup pyenv:' 06:39:28 Setup pyenv: 06:39:28 + export PYENV_ROOT=/opt/pyenv 06:39:28 + PYENV_ROOT=/opt/pyenv 06:39:28 + 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 06:39:28 + 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 06:39:28 + pyenv versions 06:39:28 system 06:39:28 3.8.20 06:39:28 3.9.20 06:39:28 3.10.15 06:39:28 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:39:28 + command -v pyenv 06:39:28 ++ pyenv init - --no-rehash 06:39:28 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 06:39:28 for i in ${!paths[@]}; do 06:39:28 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 06:39:28 fi; done; 06:39:28 echo "${paths[*]}"'\'')" 06:39:28 export PATH="/opt/pyenv/shims:${PATH}" 06:39:28 export PYENV_SHELL=bash 06:39:28 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 06:39:28 pyenv() { 06:39:28 local command 06:39:28 command="${1:-}" 06:39:28 if [ "$#" -gt 0 ]; then 06:39:28 shift 06:39:28 fi 06:39:28 06:39:28 case "$command" in 06:39:28 rehash|shell) 06:39:28 eval "$(pyenv "sh-$command" "$@")" 06:39:28 ;; 06:39:28 *) 06:39:28 command pyenv "$command" "$@" 06:39:28 ;; 06:39:28 esac 06:39:28 }' 06:39:28 +++ bash --norc -ec 'IFS=:; paths=($PATH); 06:39:28 for i in ${!paths[@]}; do 06:39:28 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 06:39:28 fi; done; 06:39:28 echo "${paths[*]}"' 06:39:28 ++ 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 06:39:28 ++ 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 06:39:28 ++ 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 06:39:28 ++ export PYENV_SHELL=bash 06:39:28 ++ PYENV_SHELL=bash 06:39:28 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 06:39:28 +++ complete -F _pyenv pyenv 06:39:28 ++ lf-pyver python3 06:39:28 ++ local py_version_xy=python3 06:39:28 ++ local py_version_xyz= 06:39:28 ++ pyenv versions 06:39:28 ++ local command 06:39:28 ++ command=versions 06:39:28 ++ '[' 1 -gt 0 ']' 06:39:28 ++ shift 06:39:28 ++ case "$command" in 06:39:28 ++ command pyenv versions 06:39:28 ++ grep -E '^[0-9.]*[0-9]$' 06:39:28 ++ sed 's/^[ *]* //' 06:39:28 ++ awk '{ print $1 }' 06:39:28 ++ [[ ! -s /tmp/.pyenv_versions ]] 06:39:28 +++ grep '^3' /tmp/.pyenv_versions 06:39:28 +++ sort -V 06:39:28 +++ tail -n 1 06:39:28 ++ py_version_xyz=3.11.10 06:39:28 ++ [[ -z 3.11.10 ]] 06:39:28 ++ echo 3.11.10 06:39:28 ++ return 0 06:39:28 + pyenv local 3.11.10 06:39:28 + local command 06:39:28 + command=local 06:39:28 + '[' 2 -gt 0 ']' 06:39:28 + shift 06:39:28 + case "$command" in 06:39:28 + command pyenv local 3.11.10 06:39:28 + for arg in "$@" 06:39:28 + case $arg in 06:39:28 + pkg_list+='tox ' 06:39:28 + for arg in "$@" 06:39:28 + case $arg in 06:39:28 + pkg_list+='virtualenv ' 06:39:28 + for arg in "$@" 06:39:28 + case $arg in 06:39:28 + pkg_list+='urllib3~=1.26.15 ' 06:39:28 + [[ -f /tmp/.toxenv ]] 06:39:28 ++ cat /tmp/.toxenv 06:39:28 + lf_venv=/tmp/venv-etcE 06:39:28 + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-etcE from' file:/tmp/.toxenv 06:39:28 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-etcE from file:/tmp/.toxenv 06:39:28 + echo 'lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv)' 06:39:28 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 06:39:28 + local 'pip_opts=--upgrade --quiet' 06:39:28 + pip_opts='--upgrade --quiet --trusted-host pypi.org' 06:39:28 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org' 06:39:28 + pip_opts='--upgrade --quiet --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org' 06:39:28 + [[ -n '' ]] 06:39:28 + [[ -n '' ]] 06:39:28 + echo 'lf-activate-venv(): INFO: Attempting to install with network-safe options...' 06:39:28 lf-activate-venv(): INFO: Attempting to install with network-safe options... 06:39:28 + /tmp/venv-etcE/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 06:39:29 + echo 'lf-activate-venv(): INFO: Base packages installed successfully' 06:39:29 lf-activate-venv(): INFO: Base packages installed successfully 06:39:29 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 06:39:29 + echo 'lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 ' 06:39:29 lf-activate-venv(): INFO: Installing additional packages: tox virtualenv urllib3~=1.26.15 06:39:29 + /tmp/venv-etcE/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 06:39:30 + type python3 06:39:30 + true 06:39:30 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-etcE/bin to PATH' 06:39:30 lf-activate-venv(): INFO: Adding /tmp/venv-etcE/bin to PATH 06:39:30 + PATH=/tmp/venv-etcE/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 06:39:30 + return 0 06:39:30 + [[ -d /opt/pyenv ]] 06:39:30 + echo '---> Setting up pyenv' 06:39:30 ---> Setting up pyenv 06:39:30 + export PYENV_ROOT=/opt/pyenv 06:39:30 + PYENV_ROOT=/opt/pyenv 06:39:30 + export PATH=/opt/pyenv/bin:/tmp/venv-etcE/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 06:39:30 + PATH=/opt/pyenv/bin:/tmp/venv-etcE/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 06:39:30 ++ pwd 06:39:30 + PYTHONPATH=/w/workspace/transportpce-tox-verify-transportpce-master 06:39:30 + export PYTHONPATH 06:39:30 + export TOX_TESTENV_PASSENV=PYTHONPATH 06:39:30 + TOX_TESTENV_PASSENV=PYTHONPATH 06:39:30 + tox --version 06:39:30 4.48.1 from /tmp/venv-etcE/lib/python3.11/site-packages/tox/__init__.py 06:39:30 + PARALLEL=True 06:39:30 + TOX_OPTIONS_LIST= 06:39:30 + [[ -n '' ]] 06:39:30 + case ${PARALLEL,,} in 06:39:30 + TOX_OPTIONS_LIST=' --parallel auto --parallel-live' 06:39:30 + tox --parallel auto --parallel-live 06:39:30 + tee -a /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tox.log 06:39:32 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 06:39:32 checkbashisms: freeze> python -m pip freeze --all 06:39:32 docs-linkcheck: install_deps> python -I -m pip install -r docs/requirements.txt 06:39:32 docs: install_deps> python -I -m pip install -r docs/requirements.txt 06:39:32 checkbashisms: pip==26.0.1,setuptools==82.0.0 06:39:32 checkbashisms: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 06:39:32 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)' 06:39:32 checkbashisms: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find . -not -path '*/\.*' -name '*.sh' -exec checkbashisms -f '{}' + 06:39:33 checkbashisms: OK ✔ in 3.09 seconds 06:39:33 pre-commit: install_deps> python -I -m pip install pre-commit 06:39:36 pre-commit: freeze> python -m pip freeze --all 06:39:36 pre-commit: cfgv==3.5.0,distlib==0.4.0,filelock==3.25.0,identify==2.6.17,nodeenv==1.10.0,pip==26.0.1,platformdirs==4.9.4,pre_commit==4.5.1,python-discovery==1.1.0,PyYAML==6.0.3,setuptools==82.0.0,virtualenv==21.1.0 06:39:36 pre-commit: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 06:39:36 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)' 06:39:36 /usr/bin/cpan 06:39:36 pre-commit: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run --all-files --show-diff-on-failure 06:39:36 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 06:39:36 [WARNING] hook id `perltidy` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 06:39:36 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 06:39:37 [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. 06:39:37 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. 06:39:37 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. 06:39:37 [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. 06:39:38 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-autopep8. 06:39:38 [INFO] Initializing environment for https://github.com/perltidy/perltidy. 06:39:38 buildcontroller: freeze> python -m pip freeze --all 06:39:38 buildcontroller: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:39:38 buildcontroller: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_controller.sh 06:39:38 + update-java-alternatives -l 06:39:38 java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64 06:39:38 java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64 06:39:38 + sudo update-java-alternatives -s java-1.21.0-openjdk-amd64 06:39:38 java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 06:39:38 update-alternatives: error: no alternatives for jaotc 06:39:38 update-alternatives: error: no alternatives for rmic 06:39:39 + sed -n ;s/.* version "\(.*\)\.\(.*\)\..*".*$/\1/p; 06:39:39 + java -version 06:39:39 + JAVA_VER=21 06:39:39 + echo 21 06:39:39 21 06:39:39 + javac -version 06:39:39 + sed -n ;s/javac \(.*\)\.\(.*\)\..*.*$/\1/p; 06:39:39 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 06:39:39 [INFO] Once installed this environment will be reused. 06:39:39 [INFO] This may take a few minutes... 06:39:39 + JAVAC_VER=21 06:39:39 + echo 21 06:39:39 + [ 21 -ge 21 ] 06:39:39 + [ 21 -ge 21 ] 06:39:39 + echo ok, java is 21 or newer 06:39:39 21 06:39:39 ok, java is 21 or newer 06:39:39 + wget -nv https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz -P /tmp 06:39:40 2026-03-06 06:39:40 URL:https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz [9233336/9233336] -> "/tmp/apache-maven-3.9.12-bin.tar.gz" [1] 06:39:40 + sudo mkdir -p /opt 06:39:40 + sudo tar xf /tmp/apache-maven-3.9.12-bin.tar.gz -C /opt 06:39:40 + sudo ln -s /opt/apache-maven-3.9.12 /opt/maven 06:39:40 + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn 06:39:40 + mvn --version 06:39:40 Apache Maven 3.9.12 (848fbb4bf2d427b72bdb2471c22fced7ebd9a7a1) 06:39:40 Maven home: /opt/maven 06:39:40 Java version: 21.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 06:39:40 Default locale: en, platform encoding: UTF-8 06:39:40 OS name: "linux", version: "5.15.0-171-generic", arch: "amd64", family: "unix" 06:39:41 NOTE: Picked up JDK_JAVA_OPTIONS: 06:39:41 --add-opens=java.base/java.io=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.lang=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.net=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.nio=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.nio.file=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.util=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.util.jar=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.util.stream=ALL-UNNAMED 06:39:41 --add-opens=java.base/java.util.zip=ALL-UNNAMED 06:39:41 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 06:39:41 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 06:39:41 -Xlog:disable 06:39:44 [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. 06:39:44 [INFO] Once installed this environment will be reused. 06:39:44 [INFO] This may take a few minutes... 06:39:52 [INFO] Installing environment for https://github.com/pre-commit/mirrors-autopep8. 06:39:52 [INFO] Once installed this environment will be reused. 06:39:52 [INFO] This may take a few minutes... 06:39:56 docs: freeze> python -m pip freeze --all 06:39:57 [INFO] Installing environment for https://github.com/perltidy/perltidy. 06:39:57 [INFO] Once installed this environment will be reused. 06:39:57 [INFO] This may take a few minutes... 06:39:57 docs: alabaster==1.0.0,attrs==25.4.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.2.25,charset-normalizer==3.4.5,contourpy==1.3.3,cycler==0.12.1,docutils==0.21.2,fonttools==4.61.1,funcparserlib==2.0.0a0,future==1.0.0,idna==3.11,imagesize==2.0.0,Jinja2==3.1.6,jsonschema==3.2.0,kiwisolver==1.4.9,lfdocs_conf==0.10.0,MarkupSafe==3.0.3,matplotlib==3.10.8,numpy==2.4.2,nwdiag==3.0.0,packaging==26.0,pillow==12.1.1,pip==26.0.1,Pygments==2.19.2,pyparsing==3.3.2,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.3,requests==2.32.5,requests-file==1.5.1,roman-numerals==4.1.0,roman-numerals-py==4.1.0,seqdiag==3.0.0,setuptools==82.0.0,six==1.17.0,snowballstemmer==3.0.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.6.3,webcolors==25.10.0 06:39:57 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 06:39:57 docs-linkcheck: freeze> python -m pip freeze --all 06:39:58 docs-linkcheck: alabaster==1.0.0,attrs==25.4.0,babel==2.18.0,blockdiag==3.0.0,certifi==2026.2.25,charset-normalizer==3.4.5,contourpy==1.3.3,cycler==0.12.1,docutils==0.21.2,fonttools==4.61.1,funcparserlib==2.0.0a0,future==1.0.0,idna==3.11,imagesize==2.0.0,Jinja2==3.1.6,jsonschema==3.2.0,kiwisolver==1.4.9,lfdocs_conf==0.10.0,MarkupSafe==3.0.3,matplotlib==3.10.8,numpy==2.4.2,nwdiag==3.0.0,packaging==26.0,pillow==12.1.1,pip==26.0.1,Pygments==2.19.2,pyparsing==3.3.2,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.3,requests==2.32.5,requests-file==1.5.1,roman-numerals==4.1.0,roman-numerals-py==4.1.0,seqdiag==3.0.0,setuptools==82.0.0,six==1.17.0,snowballstemmer==3.0.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.6.3,webcolors==25.10.0 06:39:58 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 06:40:00 docs: OK ✔ in 29.06 seconds 06:40:00 pylint: install_deps> python -I -m pip install 'pylint>=2.6.0' 06:40:03 pylint: freeze> python -m pip freeze --all 06:40:04 pylint: astroid==4.0.4,dill==0.4.1,isort==8.0.1,mccabe==0.7.0,pip==26.0.1,platformdirs==4.9.4,pylint==4.0.5,setuptools==82.0.0,tomlkit==0.14.0 06:40:04 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}$' '{}' + 06:40:09 trim trailing whitespace.................................................Passed 06:40:09 Tabs remover.............................................................Passed 06:40:10 autopep8.................................................................Passed 06:40:16 perltidy.................................................................Passed 06:40:16 pre-commit: commands[3] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run gitlint-ci --hook-stage manual 06:40:17 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 06:40:17 [WARNING] hook id `perltidy` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 06:40:17 [INFO] Installing environment for https://github.com/jorisroovers/gitlint. 06:40:17 [INFO] Once installed this environment will be reused. 06:40:17 [INFO] This may take a few minutes... 06:40:25 gitlint..................................................................Passed 06:40:30 06:40:30 ------------------------------------ 06:40:30 Your code has been rated at 10.00/10 06:40:30 06:40:40 /w/workspace/transportpce-tox-verify-transportpce-master/docs/tox-guide.rst:109: WARNING: broken link: https://pre-commit.com/ (522 Server Error: for url: https://pre-commit.com/) 06:40:40 pre-commit: OK ✔ in 51.73 seconds 06:40:40 pylint: OK ✔ in 32.9 seconds 06:40:40 docs-linkcheck: exit 1 (42.05 seconds) /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 pid=4963 06:41:15 docs-linkcheck: FAIL ✖ in 1 minute 9.64 seconds 06:41:15 buildcontroller: OK ✔ in 1 minute 43.26 seconds 06:41:15 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 06:41:15 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 06:41:15 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 06:41:15 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 06:41:21 build_karaf_tests200: freeze> python -m pip freeze --all 06:41:21 build_karaf_tests221: freeze> python -m pip freeze --all 06:41:21 build_karaf_tests71: freeze> python -m pip freeze --all 06:41:21 build_karaf_tests121: freeze> python -m pip freeze --all 06:41:22 build_karaf_tests200: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:41:22 build_karaf_tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 06:41:22 build karaf in karafoc200 with ./karafoc200.env 06:41:22 build_karaf_tests221: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:41:22 build_karaf_tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 06:41:22 build karaf in karaf221 with ./karaf221.env 06:41:22 build_karaf_tests71: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:41:22 build_karaf_tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 06:41:22 build karaf in karaf71 with ./karaf71.env 06:41:22 NOTE: Picked up JDK_JAVA_OPTIONS: 06:41:22 --add-opens=java.base/java.io=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.net=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.file=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.jar=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.stream=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.zip=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 06:41:22 -Xlog:disable 06:41:22 build_karaf_tests121: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:41:22 build_karaf_tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 06:41:22 build karaf in karaf121 with ./karaf121.env 06:41:22 NOTE: Picked up JDK_JAVA_OPTIONS: 06:41:22 --add-opens=java.base/java.io=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.net=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.file=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.jar=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.stream=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.zip=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 06:41:22 -Xlog:disable 06:41:22 NOTE: Picked up JDK_JAVA_OPTIONS: 06:41:22 --add-opens=java.base/java.io=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.net=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.file=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.jar=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.stream=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.zip=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 06:41:22 -Xlog:disable 06:41:22 NOTE: Picked up JDK_JAVA_OPTIONS: 06:41:22 --add-opens=java.base/java.io=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.net=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.nio.file=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.jar=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.stream=ALL-UNNAMED 06:41:22 --add-opens=java.base/java.util.zip=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 06:41:22 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 06:41:22 -Xlog:disable 06:42:12 build_karaf_tests121: OK ✔ in 58.12 seconds 06:42:12 build_karaf_tests200: OK ✔ in 58.19 seconds 06:42:12 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 06:42:12 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 06:42:13 build_karaf_tests221: OK ✔ in 58.91 seconds 06:42:13 build_karaf_tests71: OK ✔ in 58.92 seconds 06:42:13 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 06:42:18 buildlighty: freeze> python -m pip freeze --all 06:42:18 sims: freeze> python -m pip freeze --all 06:42:18 buildlighty: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:42:18 buildlighty: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh 06:42:18 NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED 06:42:18 sims: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:42:18 sims: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_lightynode.sh 06:42:18 Using lighynode version 22.1.0.7 06:42:18 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 06:42:21 sims: OK ✔ in 9.1 seconds 06:42:21 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 06:42:29 tests71: freeze> python -m pip freeze --all 06:42:29 tests71: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:42:29 tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 7.1 06:42:29 using environment variables from ./karaf71.env 06:42:29 pytest -q transportpce_tests/7.1/test01_portmapping.py 06:43:05 buildlighty: OK ✔ in 37.2 seconds 06:43:05 testsPCE: freeze> python -m pip freeze --all 06:43:06 testsPCE: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,click==8.3.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.61.1,gnpy4tpce==2.4.7,idna==3.11,iniconfig==2.3.0,injector==0.24.0,invoke==2.2.1,itsdangerous==2.2.0,Jinja2==3.1.6,kiwisolver==1.4.9,lxml==6.0.2,MarkupSafe==3.0.3,matplotlib==3.10.8,netconf-client==3.5.0,networkx==2.8.8,numpy==1.26.4,packaging==26.0,pandas==1.5.3,paramiko==4.0.0,pbr==5.11.1,pillow==12.1.1,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pyparsing==3.3.2,pytest==9.0.2,python-dateutil==2.9.0.post0,pytz==2026.1.post1,requests==2.32.5,scipy==1.17.1,setuptools==50.3.2,six==1.17.0,urllib3==2.6.3,Werkzeug==2.0.3,xlrd==1.2.0 06:43:06 testsPCE: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce 06:43:06 pytest -q transportpce_tests/pce/test01_pce.py 06:43:08 ............ [100%] 06:43:22 12 passed in 52.51s 06:43:22 pytest -q transportpce_tests/7.1/test02_otn_renderer.py 06:43:58 ..................................................... [100%] 06:45:07 20 passed in 120.64s (0:02:00) 06:45:07 pytest -q transportpce_tests/pce/test02_pce_400G.py 06:45:08 .................................. [100%] 06:45:53 12 passed in 45.96s 06:45:53 pytest -q transportpce_tests/pce/test03_gnpy.py 06:45:54 ....... [100%] 06:46:08 62 passed in 166.38s (0:02:46) 06:46:08 pytest -q transportpce_tests/7.1/test03_renderer_or_modes.py 06:46:09 ........ [100%] 06:46:31 8 passed in 37.98s 06:46:31 pytest -q transportpce_tests/pce/test04_pce_bug_fix.py 06:46:40 ................ [100%] 06:47:10 3 passed in 38.09s 06:47:10 testsPCE: OK ✔ in 4 minutes 57.3 seconds 06:47:10 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 06:47:11 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 06:47:11 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 06:47:11 ....tests200: freeze> python -m pip freeze --all 06:47:18 tests_tapi: freeze> python -m pip freeze --all 06:47:18 tests121: freeze> python -m pip freeze --all 06:47:18 tests200: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:47:18 tests200: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh oc200 06:47:18 using environment variables from ./karafoc200.env 06:47:18 pytest -q transportpce_tests/oc200/test01_portmapping.py 06:47:18 tests_tapi: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:47:18 tests_tapi: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh tapi 06:47:18 using environment variables from ./karaf221.env 06:47:18 pytest -q transportpce_tests/tapi/test01_abstracted_topology.py 06:47:19 tests121: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 06:47:19 tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 06:47:19 using environment variables from ./karaf121.env 06:47:19 pytest -q transportpce_tests/1.2.1/test01_portmapping.py 06:47:19 ................................. [100%] 06:48:29 48 passed in 139.76s (0:02:19) 06:48:29 pytest -q transportpce_tests/7.1/test04_renderer_regen_mode.py 06:48:32 .....F.. [100%] 06:48:42 =================================== FAILURES =================================== 06:48:42 ___________ TestTransportPCEPortmapping.test_08_mpdr_switching_pool ____________ 06:48:42 06:48:42 self = 06:48:42 06:48:42 def test_08_mpdr_switching_pool(self): 06:48:42 response = test_utils.get_portmapping_node_attr("XPDR-OC", "switching-pool-lcp", "2") 06:48:42 > self.assertEqual(response['status_code'], requests.codes.ok) 06:48:42 E AssertionError: 409 != 200 06:48:42 06:48:42 transportpce_tests/oc200/test01_portmapping.py:127: AssertionError 06:48:42 ----------------------------- Captured stdout call ----------------------------- 06:48:42 execution of test_08_mpdr_switching_pool 06:48:42 =========================== short test summary info ============================ 06:48:42 FAILED transportpce_tests/oc200/test01_portmapping.py::TestTransportPCEPortmapping::test_08_mpdr_switching_pool 06:48:42 1 failed, 9 passed in 82.80s (0:01:22) 06:48:42 tests200: exit 1 (83.13 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh oc200 pid=10630 06:49:05 .................................................... [100%] 06:49:53 22 passed in 83.22s (0:01:23) 06:50:04 .....................FFFFFFFFFFFFFFFFFFFF [100%] 06:51:50 =================================== FAILURES =================================== 06:51:50 ___________ TestTransportPCEPortmapping.test_02_rdm_device_connected ___________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01', query='content=nonconfig', fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_02_rdm_device_connected(self): 06:51:50 > response = test_utils.check_device_connection("ROADMA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:54: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:409: in check_device_connection 06:51:50 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_02_rdm_device_connected 06:51:50 ___________ TestTransportPCEPortmapping.test_03_rdm_portmapping_info ___________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_03_rdm_portmapping_info(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:60: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_03_rdm_portmapping_info 06:51:50 ______ TestTransportPCEPortmapping.test_04_rdm_portmapping_DEG1_TTP_TXRX _______ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=DEG1-TTP-TXRX' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_04_rdm_portmapping_DEG1_TTP_TXRX(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "DEG1-TTP-TXRX") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:73: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_04_rdm_portmapping_DEG1_TTP_TXRX 06:51:50 ______ TestTransportPCEPortmapping.test_05_rdm_portmapping_SRG1_PP7_TXRX _______ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG1-PP7-TXRX' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_05_rdm_portmapping_SRG1_PP7_TXRX(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG1-PP7-TXRX") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:82: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_05_rdm_portmapping_SRG1_PP7_TXRX 06:51:50 ______ TestTransportPCEPortmapping.test_06_rdm_portmapping_SRG3_PP1_TXRX _______ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/mapping=SRG3-PP1-TXRX' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_06_rdm_portmapping_SRG3_PP1_TXRX(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("ROADMA01", "mapping", "SRG3-PP1-TXRX") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:91: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_06_rdm_portmapping_SRG3_PP1_TXRX 06:51:50 __________ TestTransportPCEPortmapping.test_07_xpdr_device_connection __________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'PUT' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 06:51:50 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}}]}' 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '709', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'PUT' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_07_xpdr_device_connection(self): 06:51:50 > response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:100: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:381: in mount_device 06:51:50 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:125: in put_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_07_xpdr_device_connection 06:51:50 __________ TestTransportPCEPortmapping.test_08_xpdr_device_connected ___________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01', query='content=nonconfig', fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_08_xpdr_device_connected(self): 06:51:50 > response = test_utils.check_device_connection("XPDRA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:104: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:409: in check_device_connection 06:51:50 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_08_xpdr_device_connected 06:51:50 __________ TestTransportPCEPortmapping.test_09_xpdr_portmapping_info ___________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_09_xpdr_portmapping_info(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:110: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_09_xpdr_portmapping_info 06:51:50 ________ TestTransportPCEPortmapping.test_10_xpdr_portmapping_NETWORK1 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK1' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_10_xpdr_portmapping_NETWORK1(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK1") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:123: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_10_xpdr_portmapping_NETWORK1 06:51:50 ________ TestTransportPCEPortmapping.test_11_xpdr_portmapping_NETWORK2 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-NETWORK2' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_11_xpdr_portmapping_NETWORK2(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-NETWORK2") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:135: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_11_xpdr_portmapping_NETWORK2 06:51:50 _________ TestTransportPCEPortmapping.test_12_xpdr_portmapping_CLIENT1 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT1' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_12_xpdr_portmapping_CLIENT1(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT1") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:147: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_12_xpdr_portmapping_CLIENT1 06:51:50 _________ TestTransportPCEPortmapping.test_13_xpdr_portmapping_CLIENT2 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT2' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_13_xpdr_portmapping_CLIENT2(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT2") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:159: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_13_xpdr_portmapping_CLIENT2 06:51:50 _________ TestTransportPCEPortmapping.test_14_xpdr_portmapping_CLIENT3 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT3' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_14_xpdr_portmapping_CLIENT3(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT3") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:170: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_14_xpdr_portmapping_CLIENT3 06:51:50 _________ TestTransportPCEPortmapping.test_15_xpdr_portmapping_CLIENT4 _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/mapping=XPDR1-CLIENT4' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_15_xpdr_portmapping_CLIENT4(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "mapping", "XPDR1-CLIENT4") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:182: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_15_xpdr_portmapping_CLIENT4 06:51:50 ________ TestTransportPCEPortmapping.test_16_xpdr_device_disconnection _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'DELETE' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'DELETE' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_16_xpdr_device_disconnection(self): 06:51:50 > response = test_utils.unmount_device("XPDRA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:193: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:398: in unmount_device 06:51:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:134: in delete_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_16_xpdr_device_disconnection 06:51:50 _________ TestTransportPCEPortmapping.test_17_xpdr_device_disconnected _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01', query='content=nonconfig', fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01?content=nonconfig' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_17_xpdr_device_disconnected(self): 06:51:50 > response = test_utils.check_device_connection("XPDRA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:197: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:409: in check_device_connection 06:51:50 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_17_xpdr_device_disconnected 06:51:50 ________ TestTransportPCEPortmapping.test_18_xpdr_device_not_connected _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01/node-info' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_18_xpdr_device_not_connected(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("XPDRA01", "node-info", None) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:205: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_18_xpdr_device_not_connected 06:51:50 _________ TestTransportPCEPortmapping.test_19_rdm_device_disconnection _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'DELETE' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'DELETE' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_19_rdm_device_disconnection(self): 06:51:50 > response = test_utils.unmount_device("ROADMA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:213: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:398: in unmount_device 06:51:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:134: in delete_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_19_rdm_device_disconnection 06:51:50 _________ TestTransportPCEPortmapping.test_20_rdm_device_disconnected __________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01', query='content=nonconfig', fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01?content=nonconfig' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_20_rdm_device_disconnected(self): 06:51:50 > response = test_utils.check_device_connection("ROADMA01") 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:217: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:409: in check_device_connection 06:51:50 response = get_request(url[RESTCONF_VERSION].format('{}', node)) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_20_rdm_device_disconnected 06:51:50 _________ TestTransportPCEPortmapping.test_21_rdm_device_not_connected _________ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 > sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:204: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 06:51:50 raise err 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 address = ('localhost', 8191), timeout = 30, source_address = None 06:51:50 socket_options = [(6, 1, 1)] 06:51:50 06:51:50 def create_connection( 06:51:50 address: tuple[str, int], 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 source_address: tuple[str, int] | None = None, 06:51:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 06:51:50 ) -> socket.socket: 06:51:50 """Connect to *address* and return the socket object. 06:51:50 06:51:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 06:51:50 port)``) and return the socket object. Passing the optional 06:51:50 *timeout* parameter will set the timeout on the socket instance 06:51:50 before attempting to connect. If no *timeout* is supplied, the 06:51:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 06:51:50 is used. If *source_address* is set it must be a tuple of (host, port) 06:51:50 for the socket to bind as a source address before making the connection. 06:51:50 An host of '' or port 0 tells the OS to use the default. 06:51:50 """ 06:51:50 06:51:50 host, port = address 06:51:50 if host.startswith("["): 06:51:50 host = host.strip("[]") 06:51:50 err = None 06:51:50 06:51:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 06:51:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 06:51:50 # The original create_connection function always returns all records. 06:51:50 family = allowed_gai_family() 06:51:50 06:51:50 try: 06:51:50 host.encode("idna") 06:51:50 except UnicodeError: 06:51:50 raise LocationParseError(f"'{host}', label empty or too long") from None 06:51:50 06:51:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 06:51:50 af, socktype, proto, canonname, sa = res 06:51:50 sock = None 06:51:50 try: 06:51:50 sock = socket.socket(af, socktype, proto) 06:51:50 06:51:50 # If provided, set socket level options before connecting. 06:51:50 _set_socket_options(sock, socket_options) 06:51:50 06:51:50 if timeout is not _DEFAULT_TIMEOUT: 06:51:50 sock.settimeout(timeout) 06:51:50 if source_address: 06:51:50 sock.bind(source_address) 06:51:50 > sock.connect(sa) 06:51:50 E ConnectionRefusedError: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 06:51:50 body = None 06:51:50 headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 06:51:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 redirect = False, assert_same_host = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), pool_timeout = None 06:51:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 06:51:50 decode_content = False, response_kw = {} 06:51:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info', query=None, fragment=None) 06:51:50 destination_scheme = None, conn = None, release_this_conn = True 06:51:50 http_tunnel_required = False, err = None, clean_exit = False 06:51:50 06:51:50 def urlopen( # type: ignore[override] 06:51:50 self, 06:51:50 method: str, 06:51:50 url: str, 06:51:50 body: _TYPE_BODY | None = None, 06:51:50 headers: typing.Mapping[str, str] | None = None, 06:51:50 retries: Retry | bool | int | None = None, 06:51:50 redirect: bool = True, 06:51:50 assert_same_host: bool = True, 06:51:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 06:51:50 pool_timeout: int | None = None, 06:51:50 release_conn: bool | None = None, 06:51:50 chunked: bool = False, 06:51:50 body_pos: _TYPE_BODY_POSITION | None = None, 06:51:50 preload_content: bool = True, 06:51:50 decode_content: bool = True, 06:51:50 **response_kw: typing.Any, 06:51:50 ) -> BaseHTTPResponse: 06:51:50 """ 06:51:50 Get a connection from the pool and perform an HTTP request. This is the 06:51:50 lowest level call for making a request, so you'll need to specify all 06:51:50 the raw details. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 More commonly, it's appropriate to use a convenience method 06:51:50 such as :meth:`request`. 06:51:50 06:51:50 .. note:: 06:51:50 06:51:50 `release_conn` will only behave as expected if 06:51:50 `preload_content=False` because we want to make 06:51:50 `preload_content=False` the default behaviour someday soon without 06:51:50 breaking backwards compatibility. 06:51:50 06:51:50 :param method: 06:51:50 HTTP request method (such as GET, POST, PUT, etc.) 06:51:50 06:51:50 :param url: 06:51:50 The URL to perform the request on. 06:51:50 06:51:50 :param body: 06:51:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 06:51:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 06:51:50 06:51:50 :param headers: 06:51:50 Dictionary of custom headers to send, such as User-Agent, 06:51:50 If-None-Match, etc. If None, pool headers are used. If provided, 06:51:50 these headers completely replace any pool-specific headers. 06:51:50 06:51:50 :param retries: 06:51:50 Configure the number of retries to allow before raising a 06:51:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 06:51:50 06:51:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 06:51:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 06:51:50 over different types of retries. 06:51:50 Pass an integer number to retry connection errors that many times, 06:51:50 but no other types of errors. Pass zero to never retry. 06:51:50 06:51:50 If ``False``, then retries are disabled and any exception is raised 06:51:50 immediately. Also, instead of raising a MaxRetryError on redirects, 06:51:50 the redirect response will be returned. 06:51:50 06:51:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 06:51:50 06:51:50 :param redirect: 06:51:50 If True, automatically handle redirects (status codes 301, 302, 06:51:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 06:51:50 will disable redirect, too. 06:51:50 06:51:50 :param assert_same_host: 06:51:50 If ``True``, will make sure that the host of the pool requests is 06:51:50 consistent else will raise HostChangedError. When ``False``, you can 06:51:50 use the pool on an HTTP proxy and request foreign hosts. 06:51:50 06:51:50 :param timeout: 06:51:50 If specified, overrides the default timeout for this one 06:51:50 request. It may be a float (in seconds) or an instance of 06:51:50 :class:`urllib3.util.Timeout`. 06:51:50 06:51:50 :param pool_timeout: 06:51:50 If set and the pool is set to block=True, then this method will 06:51:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 06:51:50 connection is available within the time period. 06:51:50 06:51:50 :param bool preload_content: 06:51:50 If True, the response's body will be preloaded into memory. 06:51:50 06:51:50 :param bool decode_content: 06:51:50 If True, will attempt to decode the body based on the 06:51:50 'content-encoding' header. 06:51:50 06:51:50 :param release_conn: 06:51:50 If False, then the urlopen call will not release the connection 06:51:50 back into the pool once a response is received (but will release if 06:51:50 you read the entire contents of the response such as when 06:51:50 `preload_content=True`). This is useful if you're not preloading 06:51:50 the response's content immediately. You will need to call 06:51:50 ``r.release_conn()`` on the response ``r`` to return the connection 06:51:50 back into the pool. If None, it takes the value of ``preload_content`` 06:51:50 which defaults to ``True``. 06:51:50 06:51:50 :param bool chunked: 06:51:50 If True, urllib3 will send the body using chunked transfer 06:51:50 encoding. Otherwise, urllib3 will send the body using the standard 06:51:50 content-length form. Defaults to False. 06:51:50 06:51:50 :param int body_pos: 06:51:50 Position to seek to in file-like body in the event of a retry or 06:51:50 redirect. Typically this won't need to be set because urllib3 will 06:51:50 auto-populate the value when needed. 06:51:50 """ 06:51:50 parsed_url = parse_url(url) 06:51:50 destination_scheme = parsed_url.scheme 06:51:50 06:51:50 if headers is None: 06:51:50 headers = self.headers 06:51:50 06:51:50 if not isinstance(retries, Retry): 06:51:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 06:51:50 06:51:50 if release_conn is None: 06:51:50 release_conn = preload_content 06:51:50 06:51:50 # Check host 06:51:50 if assert_same_host and not self.is_same_host(url): 06:51:50 raise HostChangedError(self, url, retries) 06:51:50 06:51:50 # Ensure that the URL we're connecting to is properly encoded 06:51:50 if url.startswith("/"): 06:51:50 url = to_str(_encode_target(url)) 06:51:50 else: 06:51:50 url = to_str(parsed_url.url) 06:51:50 06:51:50 conn = None 06:51:50 06:51:50 # Track whether `conn` needs to be released before 06:51:50 # returning/raising/recursing. Update this variable if necessary, and 06:51:50 # leave `release_conn` constant throughout the function. That way, if 06:51:50 # the function recurses, the original value of `release_conn` will be 06:51:50 # passed down into the recursive call, and its value will be respected. 06:51:50 # 06:51:50 # See issue #651 [1] for details. 06:51:50 # 06:51:50 # [1] 06:51:50 release_this_conn = release_conn 06:51:50 06:51:50 http_tunnel_required = connection_requires_http_tunnel( 06:51:50 self.proxy, self.proxy_config, destination_scheme 06:51:50 ) 06:51:50 06:51:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 06:51:50 # have to copy the headers dict so we can safely change it without those 06:51:50 # changes being reflected in anyone else's copy. 06:51:50 if not http_tunnel_required: 06:51:50 headers = headers.copy() # type: ignore[attr-defined] 06:51:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 06:51:50 06:51:50 # Must keep the exception bound to a separate variable or else Python 3 06:51:50 # complains about UnboundLocalError. 06:51:50 err = None 06:51:50 06:51:50 # Keep track of whether we cleanly exited the except block. This 06:51:50 # ensures we do proper cleanup in finally. 06:51:50 clean_exit = False 06:51:50 06:51:50 # Rewind body position, if needed. Record current position 06:51:50 # for future rewinds in the event of a redirect/retry. 06:51:50 body_pos = set_file_position(body, body_pos) 06:51:50 06:51:50 try: 06:51:50 # Request a connection from the queue. 06:51:50 timeout_obj = self._get_timeout(timeout) 06:51:50 conn = self._get_conn(timeout=pool_timeout) 06:51:50 06:51:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 06:51:50 06:51:50 # Is this a closed/new connection that requires CONNECT tunnelling? 06:51:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 06:51:50 try: 06:51:50 self._prepare_proxy(conn) 06:51:50 except (BaseSSLError, OSError, SocketTimeout) as e: 06:51:50 self._raise_timeout( 06:51:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 06:51:50 ) 06:51:50 raise 06:51:50 06:51:50 # If we're going to release the connection in ``finally:``, then 06:51:50 # the response doesn't need to know about the connection. Otherwise 06:51:50 # it will also try to release it and we'll have a double-release 06:51:50 # mess. 06:51:50 response_conn = conn if not release_conn else None 06:51:50 06:51:50 # Make the request on the HTTPConnection object 06:51:50 > response = self._make_request( 06:51:50 conn, 06:51:50 method, 06:51:50 url, 06:51:50 timeout=timeout_obj, 06:51:50 body=body, 06:51:50 headers=headers, 06:51:50 chunked=chunked, 06:51:50 retries=retries, 06:51:50 response_conn=response_conn, 06:51:50 preload_content=preload_content, 06:51:50 decode_content=decode_content, 06:51:50 **response_kw, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:787: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:493: in _make_request 06:51:50 conn.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:500: in request 06:51:50 self.endheaders() 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1298: in endheaders 06:51:50 self._send_output(message_body, encode_chunked=encode_chunked) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:1058: in _send_output 06:51:50 self.send(msg) 06:51:50 /opt/pyenv/versions/3.11.10/lib/python3.11/http/client.py:996: in send 06:51:50 self.connect() 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:331: in connect 06:51:50 self.sock = self._new_conn() 06:51:50 ^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 06:51:50 def _new_conn(self) -> socket.socket: 06:51:50 """Establish a socket connection and set nodelay settings on it. 06:51:50 06:51:50 :return: New socket connection. 06:51:50 """ 06:51:50 try: 06:51:50 sock = connection.create_connection( 06:51:50 (self._dns_host, self.port), 06:51:50 self.timeout, 06:51:50 source_address=self.source_address, 06:51:50 socket_options=self.socket_options, 06:51:50 ) 06:51:50 except socket.gaierror as e: 06:51:50 raise NameResolutionError(self.host, self, e) from e 06:51:50 except SocketTimeout as e: 06:51:50 raise ConnectTimeoutError( 06:51:50 self, 06:51:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 06:51:50 ) from e 06:51:50 06:51:50 except OSError as e: 06:51:50 > raise NewConnectionError( 06:51:50 self, f"Failed to establish a new connection: {e}" 06:51:50 ) from e 06:51:50 E urllib3.exceptions.NewConnectionError: HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:219: NewConnectionError 06:51:50 06:51:50 The above exception was the direct cause of the following exception: 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 > resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:644: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:841: in urlopen 06:51:50 retries = retries.increment( 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 06:51:50 method = 'GET' 06:51:50 url = '/rests/data/transportpce-portmapping:network/nodes=ROADMA01/node-info' 06:51:50 response = None 06:51:50 error = NewConnectionError("HTTPConnection(host='localhost', port=8191): Failed to establish a new connection: [Errno 111] Connection refused") 06:51:50 _pool = 06:51:50 _stacktrace = 06:51:50 06:51:50 def increment( 06:51:50 self, 06:51:50 method: str | None = None, 06:51:50 url: str | None = None, 06:51:50 response: BaseHTTPResponse | None = None, 06:51:50 error: Exception | None = None, 06:51:50 _pool: ConnectionPool | None = None, 06:51:50 _stacktrace: TracebackType | None = None, 06:51:50 ) -> Self: 06:51:50 """Return a new Retry object with incremented retry counters. 06:51:50 06:51:50 :param response: A response object, or None, if the server did not 06:51:50 return a response. 06:51:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 06:51:50 :param Exception error: An error encountered during the request, or 06:51:50 None if the response was received successfully. 06:51:50 06:51:50 :return: A new ``Retry`` object. 06:51:50 """ 06:51:50 if self.total is False and error: 06:51:50 # Disabled, indicate to re-raise the error. 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 06:51:50 total = self.total 06:51:50 if total is not None: 06:51:50 total -= 1 06:51:50 06:51:50 connect = self.connect 06:51:50 read = self.read 06:51:50 redirect = self.redirect 06:51:50 status_count = self.status 06:51:50 other = self.other 06:51:50 cause = "unknown" 06:51:50 status = None 06:51:50 redirect_location = None 06:51:50 06:51:50 if error and self._is_connection_error(error): 06:51:50 # Connect retry? 06:51:50 if connect is False: 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif connect is not None: 06:51:50 connect -= 1 06:51:50 06:51:50 elif error and self._is_read_error(error): 06:51:50 # Read retry? 06:51:50 if read is False or method is None or not self._is_method_retryable(method): 06:51:50 raise reraise(type(error), error, _stacktrace) 06:51:50 elif read is not None: 06:51:50 read -= 1 06:51:50 06:51:50 elif error: 06:51:50 # Other retry? 06:51:50 if other is not None: 06:51:50 other -= 1 06:51:50 06:51:50 elif response and response.get_redirect_location(): 06:51:50 # Redirect retry? 06:51:50 if redirect is not None: 06:51:50 redirect -= 1 06:51:50 cause = "too many redirects" 06:51:50 response_redirect_location = response.get_redirect_location() 06:51:50 if response_redirect_location: 06:51:50 redirect_location = response_redirect_location 06:51:50 status = response.status 06:51:50 06:51:50 else: 06:51:50 # Incrementing because of a server error like a 500 in 06:51:50 # status_forcelist and the given method is in the allowed_methods 06:51:50 cause = ResponseError.GENERIC_ERROR 06:51:50 if response and response.status: 06:51:50 if status_count is not None: 06:51:50 status_count -= 1 06:51:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 06:51:50 status = response.status 06:51:50 06:51:50 history = self.history + ( 06:51:50 RequestHistory(method, url, error, status, redirect_location), 06:51:50 ) 06:51:50 06:51:50 new_retry = self.new( 06:51:50 total=total, 06:51:50 connect=connect, 06:51:50 read=read, 06:51:50 redirect=redirect, 06:51:50 status=status_count, 06:51:50 other=other, 06:51:50 history=history, 06:51:50 ) 06:51:50 06:51:50 if new_retry.is_exhausted(): 06:51:50 reason = error or ResponseError(cause) 06:51:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:535: MaxRetryError 06:51:50 06:51:50 During handling of the above exception, another exception occurred: 06:51:50 06:51:50 self = 06:51:50 06:51:50 def test_21_rdm_device_not_connected(self): 06:51:50 > response = test_utils.get_portmapping_node_attr("ROADMA01", "node-info", None) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 06:51:50 transportpce_tests/1.2.1/test01_portmapping.py:225: 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 transportpce_tests/common/test_utils.py:519: in get_portmapping_node_attr 06:51:50 response = get_request(target_url) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 transportpce_tests/common/test_utils.py:117: in get_request 06:51:50 return requests.request( 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 06:51:50 return session.request(method=method, url=url, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 06:51:50 resp = self.send(prep, **send_kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 06:51:50 r = adapter.send(request, **kwargs) 06:51:50 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 06:51:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 06:51:50 06:51:50 self = 06:51:50 request = , stream = False 06:51:50 timeout = Timeout(connect=30, read=30, total=None), verify = True, cert = None 06:51:50 proxies = OrderedDict() 06:51:50 06:51:50 def send( 06:51:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 06:51:50 ): 06:51:50 """Sends PreparedRequest object. Returns Response object. 06:51:50 06:51:50 :param request: The :class:`PreparedRequest ` being sent. 06:51:50 :param stream: (optional) Whether to stream the request content. 06:51:50 :param timeout: (optional) How long to wait for the server to send 06:51:50 data before giving up, as a float, or a :ref:`(connect timeout, 06:51:50 read timeout) ` tuple. 06:51:50 :type timeout: float or tuple or urllib3 Timeout object 06:51:50 :param verify: (optional) Either a boolean, in which case it controls whether 06:51:50 we verify the server's TLS certificate, or a string, in which case it 06:51:50 must be a path to a CA bundle to use 06:51:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 06:51:50 :param proxies: (optional) The proxies dictionary to apply to the request. 06:51:50 :rtype: requests.Response 06:51:50 """ 06:51:50 06:51:50 try: 06:51:50 conn = self.get_connection_with_tls_context( 06:51:50 request, verify, proxies=proxies, cert=cert 06:51:50 ) 06:51:50 except LocationValueError as e: 06:51:50 raise InvalidURL(e, request=request) 06:51:50 06:51:50 self.cert_verify(conn, request.url, verify, cert) 06:51:50 url = self.request_url(request, proxies) 06:51:50 self.add_headers( 06:51:50 request, 06:51:50 stream=stream, 06:51:50 timeout=timeout, 06:51:50 verify=verify, 06:51:50 cert=cert, 06:51:50 proxies=proxies, 06:51:50 ) 06:51:50 06:51:50 chunked = not (request.body is None or "Content-Length" in request.headers) 06:51:50 06:51:50 if isinstance(timeout, tuple): 06:51:50 try: 06:51:50 connect, read = timeout 06:51:50 timeout = TimeoutSauce(connect=connect, read=read) 06:51:50 except ValueError: 06:51:50 raise ValueError( 06:51:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 06:51:50 f"or a single float to set both timeouts to the same value." 06:51:50 ) 06:51:50 elif isinstance(timeout, TimeoutSauce): 06:51:50 pass 06:51:50 else: 06:51:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 06:51:50 06:51:50 try: 06:51:50 resp = conn.urlopen( 06:51:50 method=request.method, 06:51:50 url=url, 06:51:50 body=request.body, 06:51:50 headers=request.headers, 06:51:50 redirect=False, 06:51:50 assert_same_host=False, 06:51:50 preload_content=False, 06:51:50 decode_content=False, 06:51:50 retries=self.max_retries, 06:51:50 timeout=timeout, 06:51:50 chunked=chunked, 06:51:50 ) 06:51:50 06:51:50 except (ProtocolError, OSError) as err: 06:51:50 raise ConnectionError(err, request=request) 06:51:50 06:51:50 except MaxRetryError as e: 06:51:50 if isinstance(e.reason, ConnectTimeoutError): 06:51:50 # TODO: Remove this in 3.0.0: see #2811 06:51:50 if not isinstance(e.reason, NewConnectionError): 06:51:50 raise ConnectTimeout(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, ResponseError): 06:51:50 raise RetryError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _ProxyError): 06:51:50 raise ProxyError(e, request=request) 06:51:50 06:51:50 if isinstance(e.reason, _SSLError): 06:51:50 # This branch is for urllib3 v1.22 and later. 06:51:50 raise SSLError(e, request=request) 06:51:50 06:51:50 > raise ConnectionError(e, request=request) 06:51:50 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")) 06:51:50 06:51:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:677: ConnectionError 06:51:50 ----------------------------- Captured stdout call ----------------------------- 06:51:50 execution of test_21_rdm_device_not_connected 06:51:50 --------------------------- Captured stdout teardown --------------------------- 06:51:50 all processes killed 06:51:50 ODL log file stored 06:51:50 =========================== short test summary info ============================ 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_02_rdm_device_connected 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_03_rdm_portmapping_info 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_04_rdm_portmapping_DEG1_TTP_TXRX 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_05_rdm_portmapping_SRG1_PP7_TXRX 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_06_rdm_portmapping_SRG3_PP1_TXRX 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_07_xpdr_device_connection 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_08_xpdr_device_connected 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_09_xpdr_portmapping_info 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_10_xpdr_portmapping_NETWORK1 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_11_xpdr_portmapping_NETWORK2 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_12_xpdr_portmapping_CLIENT1 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_13_xpdr_portmapping_CLIENT2 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_14_xpdr_portmapping_CLIENT3 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_15_xpdr_portmapping_CLIENT4 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_16_xpdr_device_disconnection 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_17_xpdr_device_disconnected 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_18_xpdr_device_not_connected 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_19_rdm_device_disconnection 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_20_rdm_device_disconnected 06:51:50 FAILED transportpce_tests/1.2.1/test01_portmapping.py::TestTransportPCEPortmapping::test_21_rdm_device_not_connected 06:51:50 20 failed, 1 passed in 271.68s (0:04:31) 06:51:50 tests200: FAIL ✖ in 1 minute 31.82 seconds 06:51:50 tests71: OK ✔ in 7 minutes 31.89 seconds 06:51:50 tests121: exit 1 (271.99 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 pid=10652 06:52:23 . [100%] 06:52:27 51 passed in 308.53s (0:05:08) 06:52:27 pytest -q transportpce_tests/tapi/test02_full_topology.py 06:53:18 .................................... [100%] 06:57:55 36 passed in 327.37s (0:05:27) 06:57:55 pytest -q transportpce_tests/tapi/test03_tapi_device_change_notifications.py 06:58:42 ....................................................................... [100%] 07:06:13 71 passed in 497.32s (0:08:17) 07:06:13 pytest -q transportpce_tests/tapi/test04_topo_extension.py 07:07:03 ................... [100%] 07:08:34 19 passed in 141.50s (0:02:21) 07:08:34 pytest -q transportpce_tests/tapi/test05_pce_tapi.py 07:10:36 ...................... [100%] 07:16:12 22 passed in 457.61s (0:07:37) 07:16:12 tests121: FAIL ✖ in 4 minutes 40.71 seconds 07:16:12 tests_tapi: OK ✔ in 29 minutes 2.52 seconds 07:16:12 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 07:16:20 tests221: freeze> python -m pip freeze --all 07:16:20 tests221: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 07:16:20 tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 07:16:20 using environment variables from ./karaf221.env 07:16:20 pytest -q transportpce_tests/2.2.1/test01_portmapping.py 07:16:57 ................................... [100%] 07:17:36 35 passed in 76.20s (0:01:16) 07:17:37 pytest -q transportpce_tests/2.2.1/test02_topo_portmapping.py 07:18:07 ...... [100%] 07:18:21 6 passed in 44.09s 07:18:21 pytest -q transportpce_tests/2.2.1/test03_topology.py 07:19:03 ............................................ [100%] 07:20:38 44 passed in 136.46s (0:02:16) 07:20:38 pytest -q transportpce_tests/2.2.1/test04_otn_topology.py 07:21:12 ............ [100%] 07:21:37 12 passed in 58.71s 07:21:37 pytest -q transportpce_tests/2.2.1/test05_flex_grid.py 07:22:02 ................ [100%] 07:23:31 16 passed in 113.77s (0:01:53) 07:23:31 pytest -q transportpce_tests/2.2.1/test06_renderer_service_path_nominal.py 07:23:59 ............................... [100%] 07:24:06 31 passed in 35.21s 07:24:06 pytest -q transportpce_tests/2.2.1/test07_otn_renderer.py 07:24:41 .......................... [100%] 07:25:36 26 passed in 89.78s (0:01:29) 07:25:36 pytest -q transportpce_tests/2.2.1/test08_otn_sh_renderer.py 07:26:12 ...................... [100%] 07:27:16 22 passed in 99.10s (0:01:39) 07:27:16 pytest -q transportpce_tests/2.2.1/test09_olm.py 07:27:56 ........................................ [100%] 07:30:18 40 passed in 182.01s (0:03:02) 07:30:18 pytest -q transportpce_tests/2.2.1/test11_otn_end2end.py 07:31:00 ........................................................................ [ 74%] 07:36:37 ......................... [100%] 07:38:29 97 passed in 490.45s (0:08:10) 07:38:29 pytest -q transportpce_tests/2.2.1/test12_end2end.py 07:39:08 ...................................................... [100%] 07:45:55 54 passed in 445.87s (0:07:25) 07:45:55 pytest -q transportpce_tests/2.2.1/test14_otn_switch_end2end.py 07:46:48 ........................................................................ [ 71%] 07:51:56 ............................. [100%] 07:54:05 101 passed in 490.24s (0:08:10) 07:54:05 pytest -q transportpce_tests/2.2.1/test15_otn_end2end_with_intermediate_switch.py 07:54:59 ........................................................................ [ 67%] 08:00:45 ................................... [100%] 08:07:05 107 passed in 779.84s (0:12:59) 08:07:06 pytest -q transportpce_tests/2.2.1/test16_freq_end2end.py 08:07:48 ............................................. [100%] 08:10:26 45 passed in 199.77s (0:03:19) 08:10:26 tests221: OK ✔ in 54 minutes 13.28 seconds 08:10:26 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 08:10:32 tests_hybrid: freeze> python -m pip freeze --all 08:10:33 tests_hybrid: bcrypt==5.0.0,certifi==2026.2.25,cffi==2.0.0,charset-normalizer==3.4.5,cryptography==46.0.5,dict2xml==1.7.8,idna==3.11,iniconfig==2.3.0,invoke==2.2.1,lxml==6.0.2,netconf-client==3.5.0,packaging==26.0,paramiko==4.0.0,pip==26.0.1,pluggy==1.6.0,psutil==7.2.2,pycparser==3.0,Pygments==2.19.2,PyNaCl==1.6.2,pytest==9.0.2,requests==2.32.5,setuptools==82.0.0,urllib3==2.6.3 08:10:33 tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid 08:10:33 using environment variables from ./karaf221.env 08:10:33 pytest -q transportpce_tests/hybrid/test01_device_change_notifications.py 08:11:12 ................................................... [100%] 08:12:59 51 passed in 146.23s (0:02:26) 08:12:59 pytest -q transportpce_tests/hybrid/test02_B100G_end2end.py 08:13:41 ........................................................................ [ 66%] 08:18:01 ..................................... [100%] 08:20:08 109 passed in 428.06s (0:07:08) 08:20:08 pytest -q transportpce_tests/hybrid/test03_autonomous_reroute.py 08:20:55 ..................................................... [100%] 08:24:28 53 passed in 259.99s (0:04:19) 08:24:28 buildcontroller: OK (103.26=setup[7.99]+cmd[95.28] seconds) 08:24:28 sims: OK (9.10=setup[6.51]+cmd[2.59] seconds) 08:24:28 build_karaf_tests121: OK (58.11=setup[8.09]+cmd[50.02] seconds) 08:24:28 testsPCE: OK (297.29=setup[53.39]+cmd[243.90] seconds) 08:24:28 tests121: FAIL code 1 (280.71=setup[8.72]+cmd[271.99] seconds) 08:24:28 build_karaf_tests221: OK (58.91=setup[8.06]+cmd[50.86] seconds) 08:24:28 tests_tapi: OK (1742.52=setup[8.70]+cmd[1733.81] seconds) 08:24:28 tests221: OK (3253.28=setup[7.71]+cmd[3245.56] seconds) 08:24:28 build_karaf_tests71: OK (58.92=setup[8.07]+cmd[50.85] seconds) 08:24:28 tests71: OK (451.89=setup[7.96]+cmd[443.93] seconds) 08:24:28 build_karaf_tests200: OK (58.19=setup[8.02]+cmd[50.17] seconds) 08:24:28 tests200: FAIL code 1 (91.82=setup[8.69]+cmd[83.13] seconds) 08:24:28 tests_hybrid: OK (842.29=setup[7.14]+cmd[835.15] seconds) 08:24:28 buildlighty: OK (37.20=setup[6.50]+cmd[30.69] seconds) 08:24:28 docs: OK (29.06=setup[26.36]+cmd[2.71] seconds) 08:24:28 docs-linkcheck: FAIL code 1 (69.64=setup[27.59]+cmd[42.05] seconds) 08:24:28 checkbashisms: OK (3.08=setup[1.83]+cmd[0.00,0.05,1.19] seconds) 08:24:28 pre-commit: OK (51.73=setup[2.72]+cmd[0.00,0.00,40.32,8.69] seconds) 08:24:28 pylint: OK (32.90=setup[4.46]+cmd[28.44] seconds) 08:24:28 evaluation failed :( (6297.62 seconds) 08:24:28 + tox_status=1 08:24:28 + echo '---> Completed tox runs' 08:24:28 ---> Completed tox runs 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/build_karaf_tests121/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=build_karaf_tests121 08:24:28 + cp -r .tox/build_karaf_tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests121 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/build_karaf_tests200/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=build_karaf_tests200 08:24:28 + cp -r .tox/build_karaf_tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests200 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/build_karaf_tests221/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=build_karaf_tests221 08:24:28 + cp -r .tox/build_karaf_tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests221 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/build_karaf_tests71/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=build_karaf_tests71 08:24:28 + cp -r .tox/build_karaf_tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests71 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/buildcontroller/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=buildcontroller 08:24:28 + cp -r .tox/buildcontroller/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildcontroller 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/buildlighty/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=buildlighty 08:24:28 + cp -r .tox/buildlighty/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildlighty 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/checkbashisms/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=checkbashisms 08:24:28 + cp -r .tox/checkbashisms/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/checkbashisms 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/docs-linkcheck/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=docs-linkcheck 08:24:28 + cp -r .tox/docs-linkcheck/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs-linkcheck 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/docs/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=docs 08:24:28 + cp -r .tox/docs/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/pre-commit/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=pre-commit 08:24:28 + cp -r .tox/pre-commit/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pre-commit 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/pylint/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=pylint 08:24:28 + cp -r .tox/pylint/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pylint 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/sims/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=sims 08:24:28 + cp -r .tox/sims/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests121/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests121 08:24:28 + cp -r .tox/tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests121 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests200/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests200 08:24:28 + cp -r .tox/tests200/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests200 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests221/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests221 08:24:28 + cp -r .tox/tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests221 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests71/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests71 08:24:28 + cp -r .tox/tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests71 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/testsPCE/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=testsPCE 08:24:28 + cp -r .tox/testsPCE/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/testsPCE 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests_hybrid/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests_hybrid 08:24:28 + cp -r .tox/tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_hybrid 08:24:28 + for i in .tox/*/log 08:24:28 ++ echo .tox/tests_tapi/log 08:24:28 ++ awk -F/ '{print $2}' 08:24:28 + tox_env=tests_tapi 08:24:28 + cp -r .tox/tests_tapi/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_tapi 08:24:28 + DOC_DIR=docs/_build/html 08:24:28 + [[ -d docs/_build/html ]] 08:24:28 + echo '---> Archiving generated docs' 08:24:28 ---> Archiving generated docs 08:24:28 + mv docs/_build/html /w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 08:24:28 + echo '---> tox-run.sh ends' 08:24:28 ---> tox-run.sh ends 08:24:28 + test 1 -eq 0 08:24:28 + exit 1 08:24:28 ++ '[' 1 = 1 ']' 08:24:28 ++ '[' -x /usr/bin/clear_console ']' 08:24:28 ++ /usr/bin/clear_console -q 08:24:28 Build step 'Execute shell' marked build as failure 08:24:28 $ ssh-agent -k 08:24:28 unset SSH_AUTH_SOCK; 08:24:28 unset SSH_AGENT_PID; 08:24:28 echo Agent pid 3333 killed; 08:24:28 [ssh-agent] Stopped. 08:24:28 [PostBuildScript] - [INFO] Executing post build scripts. 08:24:28 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins14461424816645204995.sh 08:24:28 ---> sysstat.sh 08:24:29 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins16264500332240229186.sh 08:24:29 ---> package-listing.sh 08:24:29 ++ facter osfamily 08:24:29 ++ tr '[:upper:]' '[:lower:]' 08:24:29 + OS_FAMILY=debian 08:24:29 + workspace=/w/workspace/transportpce-tox-verify-transportpce-master 08:24:29 + START_PACKAGES=/tmp/packages_start.txt 08:24:29 + END_PACKAGES=/tmp/packages_end.txt 08:24:29 + DIFF_PACKAGES=/tmp/packages_diff.txt 08:24:29 + PACKAGES=/tmp/packages_start.txt 08:24:29 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 08:24:29 + PACKAGES=/tmp/packages_end.txt 08:24:29 + case "${OS_FAMILY}" in 08:24:29 + dpkg -l 08:24:29 + grep '^ii' 08:24:29 + '[' -f /tmp/packages_start.txt ']' 08:24:29 + '[' -f /tmp/packages_end.txt ']' 08:24:29 + diff /tmp/packages_start.txt /tmp/packages_end.txt 08:24:29 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 08:24:29 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 08:24:29 + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 08:24:29 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins10222381356154614451.sh 08:24:29 ---> capture-instance-metadata.sh 08:24:29 Setup pyenv: 08:24:29 system 08:24:29 3.8.20 08:24:29 3.9.20 08:24:29 3.10.15 08:24:29 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:24:30 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-TNmL from file:/tmp/.os_lf_venv 08:24:30 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:24:30 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:24:31 lf-activate-venv(): INFO: Base packages installed successfully 08:24:31 lf-activate-venv(): INFO: Installing additional packages: lftools 08:24:41 lf-activate-venv(): INFO: Adding /tmp/venv-TNmL/bin to PATH 08:24:41 INFO: Running in OpenStack, capturing instance metadata 08:24:41 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins2310551017292796095.sh 08:24:41 provisioning config files... 08:24:42 Could not find credentials [logs] for transportpce-tox-verify-transportpce-master #4516 08:24:42 copy managed file [jenkins-log-archives-settings] to file:/w/workspace/transportpce-tox-verify-transportpce-master@tmp/config14910390306831823513tmp 08:24:42 Regular expression run condition: Expression=[^.*logs-s3.*], Label=[odl-logs-s3-cloudfront-index] 08:24:42 Run condition [Regular expression match] enabling perform for step [Provide Configuration files] 08:24:42 provisioning config files... 08:24:42 copy managed file [jenkins-s3-log-ship] to file:/home/jenkins/.aws/credentials 08:24:42 [EnvInject] - Injecting environment variables from a build step. 08:24:42 [EnvInject] - Injecting as environment variables the properties content 08:24:42 SERVER_ID=logs 08:24:42 08:24:42 [EnvInject] - Variables injected successfully. 08:24:42 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins13903033283955669665.sh 08:24:42 ---> create-netrc.sh 08:24:42 WARN: Log server credential not found. 08:24:42 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6952240277271749636.sh 08:24:42 ---> python-tools-install.sh 08:24:42 Setup pyenv: 08:24:42 system 08:24:42 3.8.20 08:24:42 3.9.20 08:24:42 3.10.15 08:24:42 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:24:42 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-TNmL from file:/tmp/.os_lf_venv 08:24:42 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:24:42 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:24:44 lf-activate-venv(): INFO: Base packages installed successfully 08:24:44 lf-activate-venv(): INFO: Installing additional packages: lftools 08:24:53 lf-activate-venv(): INFO: Adding /tmp/venv-TNmL/bin to PATH 08:24:53 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins1272479137510353757.sh 08:24:53 ---> sudo-logs.sh 08:24:53 Archiving 'sudo' log.. 08:24:53 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins12292127514795175104.sh 08:24:53 ---> job-cost.sh 08:24:53 INFO: Activating Python virtual environment... 08:24:53 Setup pyenv: 08:24:53 system 08:24:53 3.8.20 08:24:53 3.9.20 08:24:53 3.10.15 08:24:53 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:24:54 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-TNmL from file:/tmp/.os_lf_venv 08:24:54 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:24:54 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:24:55 lf-activate-venv(): INFO: Base packages installed successfully 08:24:55 lf-activate-venv(): INFO: Installing additional packages: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 08:25:01 lf-activate-venv(): INFO: Adding /tmp/venv-TNmL/bin to PATH 08:25:01 INFO: No stack-cost file found 08:25:01 INFO: Instance uptime: 26843s 08:25:01 INFO: Fetching instance metadata (attempt 1 of 3)... 08:25:01 DEBUG: URL: http://169.254.169.254/latest/meta-data/instance-type 08:25:01 INFO: Successfully fetched instance metadata 08:25:01 INFO: Instance type: v3-standard-4 08:25:01 INFO: Retrieving pricing info for: v3-standard-4 08:25:01 INFO: Fetching Vexxhost pricing API (attempt 1 of 3)... 08:25:01 DEBUG: URL: https://pricing.vexxhost.net/v1/pricing/v3-standard-4/cost?seconds=26843 08:25:02 INFO: Successfully fetched Vexxhost pricing API 08:25:02 INFO: Retrieved cost: 0.88 08:25:02 INFO: Retrieved resource: v3-standard-4 08:25:02 INFO: Creating archive directory: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost 08:25:02 INFO: Archiving costs to: /w/workspace/transportpce-tox-verify-transportpce-master/archives/cost.csv 08:25:02 INFO: Successfully archived job cost data 08:25:02 DEBUG: Cost data: transportpce-tox-verify-transportpce-master,4516,2026-03-06 08:25:02,v3-standard-4,26843,0.88,0.00,FAILURE 08:25:02 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins2149006869251688286.sh 08:25:02 ---> logs-deploy.sh 08:25:02 Setup pyenv: 08:25:02 system 08:25:02 3.8.20 08:25:02 3.9.20 08:25:02 3.10.15 08:25:02 * 3.11.10 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 08:25:02 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-TNmL from file:/tmp/.os_lf_venv 08:25:02 lf-activate-venv(): INFO: Installing base packages (pip, setuptools, virtualenv) 08:25:02 lf-activate-venv(): INFO: Attempting to install with network-safe options... 08:25:04 lf-activate-venv(): INFO: Base packages installed successfully 08:25:04 lf-activate-venv(): INFO: Installing additional packages: lftools urllib3~=1.26.15 08:25:13 lf-activate-venv(): INFO: Adding /tmp/venv-TNmL/bin to PATH 08:25:13 WARNING: Nexus logging server not set 08:25:13 INFO: S3 path logs/releng/vex-yul-odl-jenkins-1/transportpce-tox-verify-transportpce-master/4516/ 08:25:13 INFO: archiving logs to S3 08:25:13 /tmp/venv-TNmL/lib/python3.11/site-packages/requests/__init__.py:113: RequestsDependencyWarning: urllib3 (1.26.20) or chardet (7.0.1)/charset_normalizer (3.4.5) doesn't match a supported version! 08:25:13 warnings.warn( 08:25:15 ---> uname -a: 08:25:15 Linux prd-ubuntu2204-docker-4c-16g-92727 5.15.0-171-generic #181-Ubuntu SMP Fri Feb 6 22:44:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux 08:25:15 08:25:15 08:25:15 ---> lscpu: 08:25:15 Architecture: x86_64 08:25:15 CPU op-mode(s): 32-bit, 64-bit 08:25:15 Address sizes: 40 bits physical, 48 bits virtual 08:25:15 Byte Order: Little Endian 08:25:15 CPU(s): 4 08:25:15 On-line CPU(s) list: 0-3 08:25:15 Vendor ID: AuthenticAMD 08:25:15 Model name: AMD EPYC-Rome Processor 08:25:15 CPU family: 23 08:25:15 Model: 49 08:25:15 Thread(s) per core: 1 08:25:15 Core(s) per socket: 1 08:25:15 Socket(s): 4 08:25:15 Stepping: 0 08:25:15 BogoMIPS: 5599.99 08:25:15 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 08:25:15 Virtualization: AMD-V 08:25:15 Hypervisor vendor: KVM 08:25:15 Virtualization type: full 08:25:15 L1d cache: 128 KiB (4 instances) 08:25:15 L1i cache: 128 KiB (4 instances) 08:25:15 L2 cache: 2 MiB (4 instances) 08:25:15 L3 cache: 64 MiB (4 instances) 08:25:15 NUMA node(s): 1 08:25:15 NUMA node0 CPU(s): 0-3 08:25:15 Vulnerability Gather data sampling: Not affected 08:25:15 Vulnerability Indirect target selection: Not affected 08:25:15 Vulnerability Itlb multihit: Not affected 08:25:15 Vulnerability L1tf: Not affected 08:25:15 Vulnerability Mds: Not affected 08:25:15 Vulnerability Meltdown: Not affected 08:25:15 Vulnerability Mmio stale data: Not affected 08:25:15 Vulnerability Reg file data sampling: Not affected 08:25:15 Vulnerability Retbleed: Mitigation; untrained return thunk; SMT disabled 08:25:15 Vulnerability Spec rstack overflow: Mitigation; SMT disabled 08:25:15 Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp 08:25:15 Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization 08:25:15 Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected 08:25:15 Vulnerability Srbds: Not affected 08:25:15 Vulnerability Tsa: Not affected 08:25:15 Vulnerability Tsx async abort: Not affected 08:25:15 Vulnerability Vmscape: Not affected 08:25:15 08:25:15 08:25:15 ---> nproc: 08:25:15 4 08:25:15 08:25:15 08:25:15 ---> df -h: 08:25:15 Filesystem Size Used Avail Use% Mounted on 08:25:15 tmpfs 1.6G 1.1M 1.6G 1% /run 08:25:15 /dev/vda1 78G 18G 61G 23% / 08:25:15 tmpfs 7.9G 0 7.9G 0% /dev/shm 08:25:15 tmpfs 5.0M 0 5.0M 0% /run/lock 08:25:15 /dev/vda15 105M 6.1M 99M 6% /boot/efi 08:25:15 tmpfs 1.6G 4.0K 1.6G 1% /run/user/1001 08:25:15 08:25:15 08:25:15 ---> free -m: 08:25:15 total used free shared buff/cache available 08:25:15 Mem: 15989 723 9304 3 5961 14923 08:25:15 Swap: 1023 0 1023 08:25:15 08:25:15 08:25:15 ---> ip addr: 08:25:15 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 08:25:15 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 08:25:15 inet 127.0.0.1/8 scope host lo 08:25:15 valid_lft forever preferred_lft forever 08:25:15 inet6 ::1/128 scope host 08:25:15 valid_lft forever preferred_lft forever 08:25:15 2: ens3: mtu 1458 qdisc mq state UP group default qlen 1000 08:25:15 link/ether fa:16:3e:a9:e4:37 brd ff:ff:ff:ff:ff:ff 08:25:15 altname enp0s3 08:25:15 inet 10.30.170.147/23 metric 100 brd 10.30.171.255 scope global dynamic ens3 08:25:15 valid_lft 59551sec preferred_lft 59551sec 08:25:15 inet6 fe80::f816:3eff:fea9:e437/64 scope link 08:25:15 valid_lft forever preferred_lft forever 08:25:15 3: docker0: mtu 1458 qdisc noqueue state DOWN group default 08:25:15 link/ether 12:7a:a7:12:51:e0 brd ff:ff:ff:ff:ff:ff 08:25:15 inet 10.250.0.254/24 brd 10.250.0.255 scope global docker0 08:25:15 valid_lft forever preferred_lft forever 08:25:15 08:25:15 08:25:15 ---> sar -b -r -n DEV: 08:25:15 Linux 5.15.0-171-generic (prd-ubuntu2204-docker-4c-16g-92727) 03/06/26 _x86_64_ (4 CPU) 08:25:15 08:25:15 00:57:49 LINUX RESTART (4 CPU) 08:25:15 08:25:15 01:00:21 tps rtps wtps dtps bread/s bwrtn/s bdscd/s 08:25:15 01:10:30 3.07 0.08 2.80 0.20 4.34 233.60 233.98 08:25:15 01:20:30 1.36 0.01 1.35 0.00 0.05 16.05 0.19 08:25:15 01:30:30 1.23 0.00 1.23 0.00 0.00 14.53 0.00 08:25:15 01:40:30 1.25 0.00 1.25 0.00 0.00 14.65 0.00 08:25:15 01:50:01 1.21 0.00 1.21 0.00 0.00 14.08 0.00 08:25:15 02:00:01 1.20 0.00 1.20 0.00 0.00 14.11 0.00 08:25:15 02:10:30 13.56 0.00 1.40 12.15 0.15 16.54 231407.92 08:25:15 02:20:30 1.47 0.00 1.47 0.00 0.00 16.69 0.00 08:25:15 02:30:30 1.43 0.00 1.43 0.00 0.00 16.47 0.00 08:25:15 02:40:30 1.40 0.00 1.40 0.00 0.00 16.12 0.00 08:25:15 02:50:30 1.48 0.00 1.48 0.00 0.00 16.76 0.00 08:25:15 03:00:30 1.47 0.00 1.47 0.00 0.00 16.59 0.00 08:25:15 03:10:30 1.54 0.00 1.54 0.00 0.00 17.11 0.00 08:25:15 03:20:30 1.54 0.00 1.54 0.00 0.00 17.31 0.00 08:25:15 03:30:30 1.54 0.00 1.54 0.00 0.00 17.09 0.00 08:25:15 03:40:00 1.46 0.00 1.46 0.00 0.00 16.07 0.00 08:25:15 03:50:30 1.57 0.00 1.57 0.00 0.00 17.66 0.00 08:25:15 04:00:06 1.57 0.00 1.57 0.00 0.00 17.52 0.00 08:25:15 04:10:30 1.48 0.00 1.48 0.00 0.00 16.46 0.00 08:25:15 04:20:30 1.52 0.00 1.52 0.00 0.00 17.21 0.00 08:25:15 04:30:30 1.51 0.00 1.51 0.00 0.00 16.79 0.00 08:25:15 04:40:28 1.52 0.00 1.52 0.00 0.00 17.04 0.00 08:25:15 04:50:30 1.52 0.00 1.52 0.00 0.00 16.99 0.00 08:25:15 05:00:30 1.48 0.00 1.48 0.00 0.00 16.88 0.00 08:25:15 05:10:01 1.42 0.00 1.42 0.00 0.00 15.92 0.00 08:25:15 05:20:30 1.58 0.00 1.58 0.00 0.00 17.72 0.00 08:25:15 05:30:30 1.55 0.00 1.55 0.00 0.00 17.39 0.00 08:25:15 05:40:01 1.44 0.00 1.44 0.00 0.00 16.12 0.00 08:25:15 05:50:30 1.51 0.00 1.51 0.00 0.00 17.19 0.00 08:25:15 06:00:30 1.50 0.00 1.50 0.00 0.00 16.73 0.00 08:25:15 06:10:01 1.44 0.00 1.44 0.00 0.00 16.15 0.00 08:25:15 06:20:30 1.53 0.00 1.53 0.00 0.00 17.28 0.00 08:25:15 06:30:30 1.55 0.01 1.54 0.00 0.09 17.32 0.00 08:25:15 06:40:01 53.19 2.94 48.40 1.85 169.81 3144.50 1461.14 08:25:15 06:50:07 154.43 3.46 146.49 4.47 203.72 34986.82 11700.21 08:25:15 07:00:30 9.58 1.06 8.07 0.46 9.87 225.17 1992.92 08:25:15 07:10:01 7.79 0.01 7.42 0.37 0.04 227.78 1573.89 08:25:15 07:20:08 11.45 0.74 10.26 0.46 10.37 546.99 1024.36 08:25:15 07:30:09 16.30 0.00 15.60 0.70 0.01 521.84 1166.34 08:25:15 07:40:01 7.15 0.00 6.83 0.32 0.00 215.58 485.05 08:25:15 07:50:30 5.11 0.00 4.94 0.17 0.00 147.81 381.22 08:25:15 08:00:10 5.49 0.00 5.29 0.20 0.01 160.60 113.43 08:25:15 08:10:01 4.83 0.00 4.65 0.18 0.00 149.77 48.01 08:25:15 08:20:08 8.91 0.06 8.46 0.39 1.49 550.97 366.40 08:25:15 Average: 7.87 0.19 7.17 0.51 8.97 951.43 5988.62 08:25:15 08:25:15 01:00:21 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 08:25:15 01:10:30 13731268 15525032 492056 3.01 56372 1963520 1119732 6.43 200476 2191504 216 08:25:15 01:20:30 13713424 15507612 509604 3.11 56796 1963516 1119732 6.43 200912 2210404 8 08:25:15 01:30:30 13710656 15505236 511884 3.13 57188 1963520 1120052 6.43 201288 2215380 16 08:25:15 01:40:30 13708640 15503816 513300 3.14 57620 1963660 1119988 6.43 201736 2215328 12 08:25:15 01:50:01 13707632 15503172 513864 3.14 57972 1963660 1119988 6.43 202088 2215376 100 08:25:15 02:00:01 13706120 15502176 514976 3.15 58356 1963796 1119988 6.43 202464 2215568 160 08:25:15 02:10:30 13701588 15503400 513696 3.14 59160 1968744 1119988 6.43 208048 2215736 12 08:25:15 02:20:30 13698312 15500724 516432 3.15 59760 1968752 1119988 6.43 208636 2216096 8 08:25:15 02:30:30 13697556 15500584 516528 3.15 60360 1968760 1119988 6.43 209232 2216444 8 08:25:15 02:40:30 13697304 15501060 516060 3.15 60936 1968896 1120100 6.43 209816 2217208 8 08:25:15 02:50:30 13697056 15501472 515668 3.15 61560 1968912 1120052 6.43 210464 2217012 172 08:25:15 03:00:30 13696760 15501792 515372 3.15 62152 1968920 1120052 6.43 211064 2217156 188 08:25:15 03:10:30 13696104 15501840 515260 3.15 62728 1969056 1120052 6.43 211616 2217260 8 08:25:15 03:20:30 13694984 15501324 515788 3.15 63320 1969060 1120052 6.43 212200 2217300 8 08:25:15 03:30:30 13694324 15501436 515668 3.15 63912 1969200 1120052 6.43 212824 2217572 56 08:25:15 03:40:00 13695216 15502844 514220 3.14 64456 1969204 1120052 6.43 213328 2218516 204 08:25:15 03:50:30 13693452 15501728 515324 3.15 65072 1969224 1120052 6.43 213952 2217636 180 08:25:15 04:00:06 13692448 15501468 515500 3.15 65640 1969348 1120120 6.43 214544 2217780 100 08:25:15 04:10:30 13691944 15501564 515376 3.15 66232 1969356 1120120 6.43 215128 2217824 20 08:25:15 04:20:30 13690432 15500652 516268 3.15 66832 1969376 1120120 6.43 215704 2217872 8 08:25:15 04:30:30 13689428 15500260 516672 3.16 67400 1969384 1120120 6.43 216304 2217904 12 08:25:15 04:40:28 13688924 15500356 516560 3.15 67984 1969392 1120120 6.43 216888 2217744 8 08:25:15 04:50:30 13688212 15500332 516620 3.16 68568 1969468 1120184 6.43 217472 2218148 60 08:25:15 05:00:30 13687276 15500240 516556 3.15 69128 1969736 1120184 6.43 218032 2218448 4 08:25:15 05:10:01 13685012 15498536 518336 3.17 69672 1969740 1120184 6.43 218584 2218624 204 08:25:15 05:20:30 13684760 15498880 517960 3.16 70280 1969752 1120184 6.43 219160 2218504 8 08:25:15 05:30:30 13684256 15499000 517840 3.16 70888 1969756 1120184 6.43 219768 2218512 8 08:25:15 05:40:01 13683500 15498960 517904 3.16 71436 1969896 1120184 6.43 220340 2218724 8 08:25:15 05:50:30 13682744 15498820 518124 3.16 72044 1969908 1120184 6.43 220932 2218936 4 08:25:15 06:00:30 13681988 15498684 518184 3.16 72640 1969916 1128376 6.48 221536 2218760 44 08:25:15 06:10:01 13681484 15498768 518092 3.16 73204 1969924 1128376 6.48 222108 2219188 8 08:25:15 06:20:30 13680728 15498684 518132 3.16 73792 1970000 1128376 6.48 222696 2218680 8 08:25:15 06:30:30 13679720 15498576 518328 3.17 74388 1970288 1128440 6.48 223340 2219132 56 08:25:15 06:40:01 10946260 14638696 1318308 8.05 156312 3630452 2076940 11.92 427356 4574544 1121052 08:25:15 06:50:07 2143372 6983876 8942236 54.62 266324 4442200 9885552 56.74 1926224 11586608 160 08:25:15 07:00:30 4970868 9826236 6104376 37.28 267220 4456020 6815932 39.12 1978800 8733052 380 08:25:15 07:10:01 3976484 8846496 7083600 43.26 268584 4469312 8413072 48.29 1985036 9721868 152 08:25:15 07:20:08 6596440 11583940 4346540 26.55 273028 4577424 5099088 29.27 2024192 7057308 132 08:25:15 07:30:09 6429648 11492848 4437664 27.10 274608 4651376 5159172 29.61 2029776 7222160 316 08:25:15 07:40:01 6394116 11489004 4441456 27.13 275276 4682312 5167848 29.66 2031604 7254884 296 08:25:15 07:50:30 4887020 10003940 5925672 36.19 275768 4703764 6572552 37.73 2033696 8757836 504 08:25:15 08:00:10 4884600 10023932 5905540 36.07 276520 4725332 6600128 37.88 2037216 8752244 228 08:25:15 08:10:01 6311176 11473704 4456776 27.22 277192 4747820 5119728 29.39 2039400 7319800 340 08:25:15 08:20:08 10000256 15315912 616036 3.76 280584 4891884 1300100 7.46 2063336 3621724 24560 08:25:15 Average: 11805761 14391764 1604099 9.80 114529 2612126 2254670 12.94 627484 3585189 26137 08:25:15 08:25:15 01:00:21 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 08:25:15 01:10:30 lo 0.13 0.13 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 01:10:30 ens3 8.31 6.18 81.60 0.48 0.00 0.00 0.00 0.00 08:25:15 01:10:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 01:20:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 01:20:30 ens3 0.86 0.24 0.28 0.17 0.00 0.00 0.00 0.00 08:25:15 01:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 01:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 01:30:30 ens3 1.17 0.76 0.36 0.88 0.00 0.00 0.00 0.00 08:25:15 01:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 01:40:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 01:40:30 ens3 0.35 0.13 0.08 0.05 0.00 0.00 0.00 0.00 08:25:15 01:40:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 01:50:01 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 01:50:01 ens3 0.37 0.15 0.12 0.07 0.00 0.00 0.00 0.00 08:25:15 01:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:00:01 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:00:01 ens3 0.20 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 02:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:10:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:10:30 ens3 0.22 0.11 0.06 0.04 0.00 0.00 0.00 0.00 08:25:15 02:10:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:20:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:20:30 ens3 0.19 0.10 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 02:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:30:30 ens3 0.18 0.08 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 02:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:40:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:40:30 ens3 0.34 0.13 0.11 0.06 0.00 0.00 0.00 0.00 08:25:15 02:40:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 02:50:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 02:50:30 ens3 0.18 0.08 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 02:50:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:00:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:00:30 ens3 0.17 0.08 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 03:00:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:10:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:10:30 ens3 0.20 0.11 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 03:10:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:20:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:20:30 ens3 0.16 0.10 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 03:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:30:30 ens3 0.30 0.14 0.10 0.06 0.00 0.00 0.00 0.00 08:25:15 03:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:40:00 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:40:00 ens3 0.19 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 03:40:00 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 03:50:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 03:50:30 ens3 0.16 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 03:50:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:00:06 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:00:06 ens3 0.17 0.10 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 04:00:06 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:10:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:10:30 ens3 0.21 0.12 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 04:10:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:20:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:20:30 ens3 0.17 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 04:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:30:30 ens3 0.17 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 04:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:40:28 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:40:28 ens3 0.17 0.08 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 04:40:28 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 04:50:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 04:50:30 ens3 0.30 0.13 0.10 0.06 0.00 0.00 0.00 0.00 08:25:15 04:50:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:00:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:00:30 ens3 0.34 0.14 0.11 0.07 0.00 0.00 0.00 0.00 08:25:15 05:00:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:10:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:10:01 ens3 0.22 0.11 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 05:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:20:30 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:20:30 ens3 0.17 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 05:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:30:30 ens3 0.22 0.11 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 05:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:40:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:40:01 ens3 0.15 0.08 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 05:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 05:50:30 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 05:50:30 ens3 0.17 0.09 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 05:50:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:00:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 06:00:30 ens3 0.16 0.07 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 06:00:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:10:01 lo 0.08 0.08 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 06:10:01 ens3 0.18 0.11 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 06:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:20:30 lo 0.11 0.11 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 06:20:30 ens3 0.17 0.10 0.04 0.02 0.00 0.00 0.00 0.00 08:25:15 06:20:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:30:30 lo 0.10 0.10 0.01 0.01 0.00 0.00 0.00 0.00 08:25:15 06:30:30 ens3 0.22 0.10 0.07 0.04 0.00 0.00 0.00 0.00 08:25:15 06:30:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:40:01 lo 0.76 0.76 0.15 0.15 0.00 0.00 0.00 0.00 08:25:15 06:40:01 ens3 75.41 58.02 785.29 10.73 0.00 0.00 0.00 0.00 08:25:15 06:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 06:50:07 lo 22.96 22.96 17.98 17.98 0.00 0.00 0.00 0.00 08:25:15 06:50:07 ens3 67.03 53.52 1129.99 6.06 0.00 0.00 0.00 0.00 08:25:15 06:50:07 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:00:30 lo 13.75 13.75 7.26 7.26 0.00 0.00 0.00 0.00 08:25:15 07:00:30 ens3 1.17 0.82 0.26 1.11 0.00 0.00 0.00 0.00 08:25:15 07:00:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:10:01 lo 8.40 8.40 5.93 5.93 0.00 0.00 0.00 0.00 08:25:15 07:10:01 ens3 0.67 0.45 0.20 0.14 0.00 0.00 0.00 0.00 08:25:15 07:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:20:08 lo 13.06 13.06 5.95 5.95 0.00 0.00 0.00 0.00 08:25:15 07:20:08 ens3 0.78 0.65 0.23 0.18 0.00 0.00 0.00 0.00 08:25:15 07:20:08 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:30:09 lo 17.36 17.36 8.53 8.53 0.00 0.00 0.00 0.00 08:25:15 07:30:09 ens3 0.76 0.68 0.16 0.13 0.00 0.00 0.00 0.00 08:25:15 07:30:09 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:40:01 lo 18.40 18.40 9.22 9.22 0.00 0.00 0.00 0.00 08:25:15 07:40:01 ens3 0.65 0.67 0.15 0.12 0.00 0.00 0.00 0.00 08:25:15 07:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 07:50:30 lo 27.70 27.70 11.26 11.26 0.00 0.00 0.00 0.00 08:25:15 07:50:30 ens3 0.66 0.48 0.17 0.13 0.00 0.00 0.00 0.00 08:25:15 07:50:30 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 08:00:10 lo 18.51 18.51 10.30 10.30 0.00 0.00 0.00 0.00 08:25:15 08:00:10 ens3 0.67 0.64 0.16 0.13 0.00 0.00 0.00 0.00 08:25:15 08:00:10 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 08:10:01 lo 11.60 11.60 6.06 6.06 0.00 0.00 0.00 0.00 08:25:15 08:10:01 ens3 0.63 0.44 0.20 0.14 0.00 0.00 0.00 0.00 08:25:15 08:10:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 08:20:08 lo 23.10 23.10 10.93 10.93 0.00 0.00 0.00 0.00 08:25:15 08:20:08 ens3 1.01 0.86 0.29 0.24 0.00 0.00 0.00 0.00 08:25:15 08:20:08 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 Average: lo 4.09 4.09 2.14 2.14 0.00 0.00 0.00 0.00 08:25:15 Average: ens3 3.71 2.85 44.92 0.48 0.00 0.00 0.00 0.00 08:25:15 Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 08:25:15 08:25:15 08:25:15 ---> sar -P ALL: 08:25:15 Linux 5.15.0-171-generic (prd-ubuntu2204-docker-4c-16g-92727) 03/06/26 _x86_64_ (4 CPU) 08:25:15 08:25:15 00:57:49 LINUX RESTART (4 CPU) 08:25:15 08:25:15 01:00:21 CPU %user %nice %system %iowait %steal %idle 08:25:15 01:10:30 all 0.14 0.00 0.06 0.04 0.01 99.74 08:25:15 01:10:30 0 0.11 0.00 0.05 0.02 0.01 99.81 08:25:15 01:10:30 1 0.07 0.00 0.06 0.01 0.01 99.85 08:25:15 01:10:30 2 0.11 0.00 0.06 0.13 0.01 99.68 08:25:15 01:10:30 3 0.25 0.00 0.08 0.02 0.03 99.63 08:25:15 01:20:30 all 0.08 0.00 0.02 0.01 0.01 99.88 08:25:15 01:20:30 0 0.13 0.00 0.03 0.00 0.02 99.82 08:25:15 01:20:30 1 0.06 0.00 0.01 0.01 0.01 99.91 08:25:15 01:20:30 2 0.10 0.00 0.02 0.02 0.01 99.86 08:25:15 01:20:30 3 0.04 0.00 0.03 0.00 0.02 99.92 08:25:15 01:30:30 all 0.11 0.00 0.02 0.01 0.02 99.84 08:25:15 01:30:30 0 0.05 0.00 0.02 0.00 0.01 99.91 08:25:15 01:30:30 1 0.32 0.00 0.03 0.01 0.02 99.62 08:25:15 01:30:30 2 0.03 0.00 0.03 0.01 0.02 99.92 08:25:15 01:30:30 3 0.04 0.00 0.02 0.01 0.02 99.92 08:25:15 01:40:30 all 0.12 0.00 0.02 0.01 0.02 99.83 08:25:15 01:40:30 0 0.38 0.00 0.02 0.00 0.01 99.58 08:25:15 01:40:30 1 0.05 0.00 0.03 0.00 0.02 99.91 08:25:15 01:40:30 2 0.03 0.00 0.02 0.02 0.01 99.92 08:25:15 01:40:30 3 0.02 0.00 0.03 0.01 0.02 99.91 08:25:15 01:50:01 all 0.11 0.00 0.02 0.01 0.01 99.84 08:25:15 01:50:01 0 0.38 0.00 0.01 0.00 0.01 99.60 08:25:15 01:50:01 1 0.02 0.00 0.02 0.00 0.01 99.94 08:25:15 01:50:01 2 0.02 0.00 0.02 0.01 0.01 99.95 08:25:15 01:50:01 3 0.03 0.00 0.04 0.02 0.03 99.88 08:25:15 02:00:01 all 0.08 0.00 0.02 0.01 0.02 99.87 08:25:15 02:00:01 0 0.28 0.00 0.02 0.01 0.02 99.68 08:25:15 02:00:01 1 0.02 0.00 0.02 0.00 0.02 99.95 08:25:15 02:00:01 2 0.01 0.00 0.02 0.00 0.01 99.96 08:25:15 02:00:01 3 0.03 0.00 0.02 0.03 0.02 99.90 08:25:15 02:10:30 all 0.19 0.00 0.02 0.03 0.02 99.74 08:25:15 02:10:30 0 0.70 0.00 0.02 0.00 0.02 99.26 08:25:15 02:10:30 1 0.02 0.00 0.02 0.00 0.02 99.93 08:25:15 02:10:30 2 0.03 0.00 0.03 0.08 0.01 99.85 08:25:15 02:10:30 3 0.02 0.00 0.02 0.03 0.01 99.92 08:25:15 02:20:30 all 0.02 0.00 0.02 0.29 0.01 99.65 08:25:15 02:20:30 0 0.02 0.00 0.04 0.01 0.03 99.89 08:25:15 02:20:30 1 0.02 0.00 0.02 0.46 0.01 99.49 08:25:15 02:20:30 2 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 02:20:30 3 0.01 0.00 0.02 0.70 0.01 99.26 08:25:15 02:30:30 all 0.12 0.00 0.02 0.01 0.01 99.83 08:25:15 02:30:30 0 0.44 0.00 0.04 0.03 0.03 99.47 08:25:15 02:30:30 1 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 02:30:30 2 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 02:30:30 3 0.01 0.00 0.01 0.01 0.01 99.96 08:25:15 02:40:30 all 0.17 0.00 0.02 0.01 0.01 99.78 08:25:15 02:40:30 0 0.61 0.00 0.03 0.02 0.02 99.32 08:25:15 02:40:30 1 0.03 0.00 0.02 0.01 0.01 99.92 08:25:15 02:40:30 2 0.02 0.00 0.03 0.00 0.02 99.93 08:25:15 02:40:30 3 0.02 0.00 0.02 0.01 0.01 99.94 08:25:15 02:50:30 all 0.16 0.00 0.02 0.01 0.01 99.79 08:25:15 02:50:30 0 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 02:50:30 1 0.40 0.00 0.02 0.02 0.01 99.55 08:25:15 02:50:30 2 0.03 0.00 0.04 0.03 0.02 99.88 08:25:15 02:50:30 3 0.22 0.00 0.02 0.00 0.01 99.76 08:25:15 08:25:15 02:50:30 CPU %user %nice %system %iowait %steal %idle 08:25:15 03:00:30 all 0.07 0.00 0.02 0.01 0.01 99.89 08:25:15 03:00:30 0 0.01 0.00 0.01 0.00 0.01 99.97 08:25:15 03:00:30 1 0.03 0.00 0.03 0.02 0.02 99.92 08:25:15 03:00:30 2 0.22 0.00 0.04 0.01 0.03 99.71 08:25:15 03:00:30 3 0.01 0.00 0.02 0.01 0.01 99.95 08:25:15 03:10:30 all 0.15 0.00 0.03 0.01 0.01 99.80 08:25:15 03:10:30 0 0.01 0.00 0.02 0.01 0.01 99.96 08:25:15 03:10:30 1 0.03 0.00 0.02 0.01 0.01 99.94 08:25:15 03:10:30 2 0.54 0.00 0.05 0.03 0.02 99.36 08:25:15 03:10:30 3 0.02 0.00 0.02 0.01 0.01 99.94 08:25:15 03:20:30 all 0.12 0.00 0.03 0.01 0.01 99.83 08:25:15 03:20:30 0 0.02 0.00 0.01 0.00 0.00 99.97 08:25:15 03:20:30 1 0.26 0.00 0.02 0.00 0.01 99.70 08:25:15 03:20:30 2 0.17 0.00 0.03 0.03 0.02 99.75 08:25:15 03:20:30 3 0.04 0.00 0.05 0.01 0.02 99.88 08:25:15 03:30:30 all 0.18 0.00 0.03 0.01 0.01 99.77 08:25:15 03:30:30 0 0.02 0.00 0.01 0.00 0.01 99.97 08:25:15 03:30:30 1 0.16 0.00 0.03 0.00 0.02 99.79 08:25:15 03:30:30 2 0.53 0.00 0.03 0.03 0.02 99.40 08:25:15 03:30:30 3 0.03 0.00 0.04 0.00 0.02 99.91 08:25:15 03:40:00 all 0.23 0.00 0.03 0.01 0.01 99.72 08:25:15 03:40:00 0 0.01 0.00 0.01 0.00 0.00 99.98 08:25:15 03:40:00 1 0.04 0.00 0.04 0.00 0.02 99.91 08:25:15 03:40:00 2 0.86 0.00 0.04 0.03 0.02 99.05 08:25:15 03:40:00 3 0.02 0.00 0.03 0.00 0.01 99.94 08:25:15 03:50:30 all 0.03 0.00 0.02 0.01 0.01 99.93 08:25:15 03:50:30 0 0.02 0.00 0.03 0.00 0.01 99.94 08:25:15 03:50:30 1 0.02 0.00 0.03 0.02 0.01 99.92 08:25:15 03:50:30 2 0.04 0.00 0.01 0.01 0.01 99.92 08:25:15 03:50:30 3 0.02 0.00 0.02 0.00 0.01 99.94 08:25:15 04:00:06 all 0.19 0.00 0.02 0.01 0.01 99.77 08:25:15 04:00:06 0 0.40 0.00 0.03 0.02 0.02 99.53 08:25:15 04:00:06 1 0.02 0.00 0.01 0.00 0.01 99.95 08:25:15 04:00:06 2 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 04:00:06 3 0.32 0.00 0.02 0.01 0.01 99.64 08:25:15 04:10:30 all 0.12 0.00 0.02 0.01 0.01 99.83 08:25:15 04:10:30 0 0.43 0.00 0.02 0.03 0.01 99.50 08:25:15 04:10:30 1 0.02 0.00 0.03 0.00 0.02 99.92 08:25:15 04:10:30 2 0.02 0.00 0.02 0.01 0.01 99.95 08:25:15 04:10:30 3 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 04:20:30 all 0.14 0.00 0.02 0.01 0.01 99.82 08:25:15 04:20:30 0 0.17 0.00 0.01 0.00 0.01 99.81 08:25:15 04:20:30 1 0.04 0.00 0.05 0.01 0.02 99.88 08:25:15 04:20:30 2 0.32 0.00 0.02 0.02 0.01 99.63 08:25:15 04:20:30 3 0.01 0.00 0.02 0.01 0.01 99.95 08:25:15 04:30:30 all 0.14 0.00 0.03 0.01 0.01 99.81 08:25:15 04:30:30 0 0.01 0.00 0.01 0.00 0.00 99.97 08:25:15 04:30:30 1 0.02 0.00 0.02 0.03 0.01 99.92 08:25:15 04:30:30 2 0.50 0.00 0.03 0.00 0.02 99.45 08:25:15 04:30:30 3 0.04 0.00 0.04 0.01 0.02 99.90 08:25:15 04:40:28 all 0.18 0.00 0.02 0.01 0.01 99.78 08:25:15 04:40:28 0 0.01 0.00 0.02 0.03 0.01 99.94 08:25:15 04:40:28 1 0.03 0.00 0.03 0.01 0.02 99.90 08:25:15 04:40:28 2 0.64 0.00 0.01 0.00 0.01 99.33 08:25:15 04:40:28 3 0.03 0.00 0.02 0.00 0.02 99.94 08:25:15 08:25:15 04:40:28 CPU %user %nice %system %iowait %steal %idle 08:25:15 04:50:30 all 0.10 0.00 0.02 0.01 0.02 99.85 08:25:15 04:50:30 0 0.01 0.00 0.03 0.03 0.01 99.92 08:25:15 04:50:30 1 0.02 0.00 0.03 0.00 0.02 99.93 08:25:15 04:50:30 2 0.33 0.00 0.01 0.00 0.01 99.64 08:25:15 04:50:30 3 0.02 0.00 0.02 0.00 0.02 99.93 08:25:15 05:00:30 all 0.15 0.00 0.03 0.01 0.01 99.80 08:25:15 05:00:30 0 0.54 0.00 0.04 0.03 0.02 99.38 08:25:15 05:00:30 1 0.03 0.00 0.03 0.00 0.02 99.92 08:25:15 05:00:30 2 0.02 0.00 0.02 0.00 0.01 99.94 08:25:15 05:00:30 3 0.01 0.00 0.03 0.01 0.01 99.94 08:25:15 05:10:01 all 0.25 0.00 0.02 0.01 0.01 99.71 08:25:15 05:10:01 0 0.01 0.00 0.01 0.03 0.01 99.94 08:25:15 05:10:01 1 0.03 0.00 0.03 0.00 0.02 99.92 08:25:15 05:10:01 2 0.94 0.00 0.02 0.00 0.02 99.02 08:25:15 05:10:01 3 0.01 0.00 0.02 0.00 0.01 99.97 08:25:15 05:20:30 all 0.02 0.00 0.02 0.01 0.01 99.93 08:25:15 05:20:30 0 0.03 0.00 0.04 0.03 0.02 99.88 08:25:15 05:20:30 1 0.01 0.00 0.01 0.00 0.01 99.96 08:25:15 05:20:30 2 0.03 0.00 0.02 0.00 0.01 99.94 08:25:15 05:20:30 3 0.01 0.00 0.02 0.00 0.01 99.96 08:25:15 05:30:30 all 0.09 0.00 0.02 0.01 0.02 99.86 08:25:15 05:30:30 0 0.03 0.00 0.03 0.03 0.02 99.90 08:25:15 05:30:30 1 0.20 0.00 0.03 0.01 0.02 99.74 08:25:15 05:30:30 2 0.13 0.00 0.02 0.00 0.01 99.85 08:25:15 05:30:30 3 0.01 0.00 0.02 0.01 0.02 99.94 08:25:15 05:40:01 all 0.02 0.00 0.02 0.01 0.01 99.93 08:25:15 05:40:01 0 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 05:40:01 1 0.03 0.00 0.03 0.03 0.02 99.89 08:25:15 05:40:01 2 0.02 0.00 0.03 0.00 0.01 99.94 08:25:15 05:40:01 3 0.02 0.00 0.02 0.00 0.01 99.95 08:25:15 05:50:30 all 0.15 0.00 0.02 0.01 0.02 99.81 08:25:15 05:50:30 0 0.44 0.00 0.03 0.00 0.01 99.52 08:25:15 05:50:30 1 0.11 0.00 0.01 0.02 0.01 99.84 08:25:15 05:50:30 2 0.03 0.00 0.03 0.00 0.03 99.90 08:25:15 05:50:30 3 0.01 0.00 0.01 0.01 0.01 99.96 08:25:15 06:00:30 all 0.02 0.00 0.02 0.01 0.01 99.93 08:25:15 06:00:30 0 0.02 0.00 0.01 0.00 0.01 99.96 08:25:15 06:00:30 1 0.02 0.00 0.02 0.01 0.01 99.94 08:25:15 06:00:30 2 0.03 0.00 0.03 0.01 0.02 99.91 08:25:15 06:00:30 3 0.03 0.00 0.03 0.01 0.02 99.92 08:25:15 06:10:01 all 0.29 0.00 0.02 0.01 0.02 99.67 08:25:15 06:10:01 0 1.08 0.00 0.01 0.00 0.01 98.90 08:25:15 06:10:01 1 0.01 0.00 0.02 0.01 0.01 99.96 08:25:15 06:10:01 2 0.02 0.00 0.03 0.00 0.03 99.91 08:25:15 06:10:01 3 0.02 0.00 0.02 0.03 0.02 99.91 08:25:15 06:20:30 all 0.11 0.00 0.03 0.01 0.02 99.84 08:25:15 06:20:30 0 0.07 0.00 0.01 0.00 0.01 99.91 08:25:15 06:20:30 1 0.02 0.00 0.02 0.00 0.01 99.94 08:25:15 06:20:30 2 0.34 0.00 0.04 0.01 0.01 99.59 08:25:15 06:20:30 3 0.03 0.00 0.03 0.02 0.03 99.90 08:25:15 06:30:30 all 0.16 0.00 0.03 0.01 0.02 99.79 08:25:15 06:30:30 0 0.00 0.00 0.01 0.00 0.01 99.97 08:25:15 06:30:30 1 0.03 0.00 0.03 0.01 0.01 99.93 08:25:15 06:30:30 2 0.41 0.00 0.03 0.00 0.03 99.53 08:25:15 06:30:30 3 0.20 0.00 0.03 0.02 0.02 99.73 08:25:15 08:25:15 06:30:30 CPU %user %nice %system %iowait %steal %idle 08:25:15 06:40:01 all 7.00 0.00 0.70 0.32 0.02 91.95 08:25:15 06:40:01 0 5.78 0.00 0.66 0.11 0.02 93.43 08:25:15 06:40:01 1 5.86 0.00 0.57 0.12 0.02 93.42 08:25:15 06:40:01 2 8.91 0.00 0.73 0.28 0.02 90.05 08:25:15 06:40:01 3 7.45 0.00 0.85 0.77 0.04 90.90 08:25:15 06:50:07 all 61.14 0.00 2.63 0.33 0.09 35.81 08:25:15 06:50:07 0 61.91 0.00 2.54 0.36 0.09 35.10 08:25:15 06:50:07 1 60.96 0.00 2.68 0.37 0.09 35.90 08:25:15 06:50:07 2 59.51 0.00 2.53 0.41 0.09 37.47 08:25:15 06:50:07 3 62.19 0.00 2.78 0.18 0.09 34.76 08:25:15 07:00:30 all 15.16 0.00 0.60 0.03 0.08 84.14 08:25:15 07:00:30 0 14.62 0.00 0.65 0.05 0.08 84.60 08:25:15 07:00:30 1 15.49 0.00 0.63 0.06 0.08 83.74 08:25:15 07:00:30 2 15.13 0.00 0.55 0.01 0.08 84.23 08:25:15 07:00:30 3 15.38 0.00 0.55 0.02 0.07 83.97 08:25:15 07:10:01 all 15.76 0.00 0.62 0.03 0.07 83.52 08:25:15 07:10:01 0 15.36 0.00 0.63 0.03 0.06 83.93 08:25:15 07:10:01 1 16.03 0.00 0.61 0.06 0.07 83.24 08:25:15 07:10:01 2 15.23 0.00 0.64 0.01 0.07 84.04 08:25:15 07:10:01 3 16.44 0.00 0.61 0.02 0.07 82.86 08:25:15 07:20:08 all 15.98 0.00 0.61 0.05 0.07 83.29 08:25:15 07:20:08 0 15.53 0.00 0.61 0.10 0.07 83.70 08:25:15 07:20:08 1 16.63 0.00 0.67 0.03 0.07 82.59 08:25:15 07:20:08 2 16.44 0.00 0.64 0.04 0.07 82.80 08:25:15 07:20:08 3 15.31 0.00 0.52 0.03 0.07 84.07 08:25:15 07:30:09 all 24.09 0.00 0.84 0.06 0.07 74.94 08:25:15 07:30:09 0 24.39 0.00 0.84 0.04 0.07 74.66 08:25:15 07:30:09 1 24.13 0.00 0.76 0.09 0.07 74.94 08:25:15 07:30:09 2 23.97 0.00 0.82 0.05 0.07 75.09 08:25:15 07:30:09 3 23.87 0.00 0.93 0.05 0.08 75.07 08:25:15 07:40:01 all 13.32 0.00 0.48 0.03 0.07 86.10 08:25:15 07:40:01 0 12.87 0.00 0.47 0.02 0.07 86.57 08:25:15 07:40:01 1 13.74 0.00 0.51 0.05 0.07 85.64 08:25:15 07:40:01 2 13.32 0.00 0.41 0.03 0.07 86.17 08:25:15 07:40:01 3 13.36 0.00 0.55 0.02 0.07 86.01 08:25:15 07:50:30 all 9.76 0.00 0.44 0.03 0.07 89.71 08:25:15 07:50:30 0 9.60 0.00 0.39 0.00 0.07 89.94 08:25:15 07:50:30 1 9.73 0.00 0.49 0.03 0.07 89.67 08:25:15 07:50:30 2 9.96 0.00 0.47 0.05 0.07 89.45 08:25:15 07:50:30 3 9.74 0.00 0.39 0.02 0.07 89.78 08:25:15 08:00:10 all 9.53 0.00 0.38 0.02 0.07 89.99 08:25:15 08:00:10 0 9.19 0.00 0.39 0.02 0.06 90.33 08:25:15 08:00:10 1 9.87 0.00 0.39 0.01 0.07 89.67 08:25:15 08:00:10 2 9.49 0.00 0.38 0.03 0.07 90.03 08:25:15 08:00:10 3 9.58 0.00 0.37 0.04 0.07 89.95 08:25:15 08:10:01 all 6.98 0.00 0.32 0.02 0.07 92.61 08:25:15 08:10:01 0 7.04 0.00 0.34 0.03 0.07 92.52 08:25:15 08:10:01 1 6.90 0.00 0.28 0.00 0.07 92.75 08:25:15 08:10:01 2 6.73 0.00 0.32 0.03 0.08 92.85 08:25:15 08:10:01 3 7.26 0.00 0.34 0.02 0.06 92.32 08:25:15 08:20:08 all 13.43 0.00 0.52 0.03 0.07 85.94 08:25:15 08:20:08 0 13.11 0.00 0.55 0.02 0.07 86.25 08:25:15 08:20:08 1 13.47 0.00 0.46 0.03 0.08 85.97 08:25:15 08:20:08 2 13.78 0.00 0.53 0.08 0.07 85.54 08:25:15 08:20:08 3 13.37 0.00 0.53 0.02 0.07 86.01 08:25:15 08:25:15 Average: CPU %user %nice %system %iowait %steal %idle 08:25:15 Average: all 4.47 0.00 0.20 0.04 0.03 95.26 08:25:15 Average: 0 4.46 0.00 0.20 0.03 0.03 95.29 08:25:15 Average: 1 4.44 0.00 0.20 0.04 0.03 95.29 08:25:15 Average: 2 4.53 0.00 0.20 0.03 0.03 95.21 08:25:15 Average: 3 4.45 0.00 0.21 0.05 0.03 95.27 08:25:15 08:25:15 08:25:15