10:57:57 Triggered by Gerrit: https://git.opendaylight.org/gerrit/c/transportpce/+/109402 10:57:57 Running as SYSTEM 10:57:57 [EnvInject] - Loading node environment variables. 10:57:57 Building remotely on prd-centos8-builder-4c-16g-17907 (centos8-builder-4c-16g) in workspace /w/workspace/transportpce-tox-verify-transportpce-master 10:57:58 [ssh-agent] Looking for ssh-agent implementation... 10:57:58 [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) 10:57:58 $ ssh-agent 10:57:58 SSH_AUTH_SOCK=/tmp/ssh-OmYNaHppFPYZ/agent.5560 10:57:58 SSH_AGENT_PID=5562 10:57:58 [ssh-agent] Started. 10:57:58 Running ssh-add (command line suppressed) 10:57:58 Identity added: /w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_10325426774671682688.key (/w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_10325426774671682688.key) 10:57:58 [ssh-agent] Using credentials jenkins (jenkins-ssh) 10:57:58 The recommended git tool is: NONE 10:58:01 using credential jenkins-ssh 10:58:01 Wiping out workspace first. 10:58:01 Cloning the remote Git repository 10:58:01 Cloning repository git://devvexx.opendaylight.org/mirror/transportpce 10:58:01 > git init /w/workspace/transportpce-tox-verify-transportpce-master # timeout=10 10:58:01 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 10:58:01 > git --version # timeout=10 10:58:01 > git --version # 'git version 2.43.0' 10:58:01 using GIT_SSH to set credentials jenkins-ssh 10:58:01 [INFO] Currently running in a labeled security context 10:58:01 [INFO] Currently SELinux is 'enforcing' on the host 10:58:01 > /usr/bin/chcon --type=ssh_home_t /w/workspace/transportpce-tox-verify-transportpce-master@tmp/jenkins-gitclient-ssh12797249742445154415.key 10:58:01 Verifying host key using known hosts file 10:58:01 You're using 'Known hosts file' strategy to verify ssh host keys, but your known_hosts file does not exist, please go to 'Manage Jenkins' -> 'Configure Global Security' -> 'Git Host Key Verification Configuration' and configure host key verification. 10:58:01 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce +refs/heads/*:refs/remotes/origin/* # timeout=10 10:58:05 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 10:58:05 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 10:58:05 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 10:58:05 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 10:58:05 using GIT_SSH to set credentials jenkins-ssh 10:58:05 [INFO] Currently running in a labeled security context 10:58:05 [INFO] Currently SELinux is 'enforcing' on the host 10:58:05 > /usr/bin/chcon --type=ssh_home_t /w/workspace/transportpce-tox-verify-transportpce-master@tmp/jenkins-gitclient-ssh502771643548279120.key 10:58:05 Verifying host key using known hosts file 10:58:05 You're using 'Known hosts file' strategy to verify ssh host keys, but your known_hosts file does not exist, please go to 'Manage Jenkins' -> 'Configure Global Security' -> 'Git Host Key Verification Configuration' and configure host key verification. 10:58:05 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce refs/changes/02/109402/9 # timeout=10 10:58:05 > git rev-parse f9242d9192d9f9b1bce446d31d97190319aa789d^{commit} # timeout=10 10:58:05 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script 10:58:05 Checking out Revision f9242d9192d9f9b1bce446d31d97190319aa789d (refs/changes/02/109402/9) 10:58:05 > git config core.sparsecheckout # timeout=10 10:58:05 > git checkout -f f9242d9192d9f9b1bce446d31d97190319aa789d # timeout=10 10:58:06 Commit message: "Refactoring of Tapi Step2" 10:58:06 > git rev-parse FETCH_HEAD^{commit} # timeout=10 10:58:06 > git rev-list --no-walk 1da768a66da84f5374c48017c6a2bd84e911c8a2 # timeout=10 10:58:06 > git remote # timeout=10 10:58:06 > git submodule init # timeout=10 10:58:06 > git submodule sync # timeout=10 10:58:06 > git config --get remote.origin.url # timeout=10 10:58:06 > git submodule init # timeout=10 10:58:06 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 10:58:06 ERROR: No submodules found. 10:58:06 provisioning config files... 10:58:06 copy managed file [npmrc] to file:/home/jenkins/.npmrc 10:58:06 copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf 10:58:06 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins15946389846163064805.sh 10:58:06 ---> python-tools-install.sh 10:58:06 Setup pyenv: 10:58:06 system 10:58:06 * 3.8.13 (set by /opt/pyenv/version) 10:58:06 * 3.9.13 (set by /opt/pyenv/version) 10:58:06 * 3.10.6 (set by /opt/pyenv/version) 10:58:11 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-oeL0 10:58:11 lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv 10:58:14 lf-activate-venv(): INFO: Installing: lftools 10:58:48 lf-activate-venv(): INFO: Adding /tmp/venv-oeL0/bin to PATH 10:58:48 Generating Requirements File 10:59:22 Python 3.10.6 10:59:23 pip 23.3.2 from /tmp/venv-oeL0/lib/python3.10/site-packages/pip (python 3.10) 10:59:23 appdirs==1.4.4 10:59:23 argcomplete==3.2.1 10:59:23 aspy.yaml==1.3.0 10:59:23 attrs==23.2.0 10:59:23 autopage==0.5.2 10:59:23 beautifulsoup4==4.12.3 10:59:23 boto3==1.34.22 10:59:23 botocore==1.34.22 10:59:23 bs4==0.0.2 10:59:23 cachetools==5.3.2 10:59:23 certifi==2023.11.17 10:59:23 cffi==1.16.0 10:59:23 cfgv==3.4.0 10:59:23 chardet==5.2.0 10:59:23 charset-normalizer==3.3.2 10:59:23 click==8.1.7 10:59:23 cliff==4.5.0 10:59:23 cmd2==2.4.3 10:59:23 cryptography==3.3.2 10:59:23 debtcollector==2.5.0 10:59:23 decorator==5.1.1 10:59:23 defusedxml==0.7.1 10:59:23 Deprecated==1.2.14 10:59:23 distlib==0.3.8 10:59:23 dnspython==2.4.2 10:59:23 docker==4.2.2 10:59:23 dogpile.cache==1.3.0 10:59:23 email-validator==2.1.0.post1 10:59:23 filelock==3.13.1 10:59:23 future==0.18.3 10:59:23 gitdb==4.0.11 10:59:23 GitPython==3.1.41 10:59:23 google-auth==2.26.2 10:59:23 httplib2==0.22.0 10:59:23 identify==2.5.33 10:59:23 idna==3.6 10:59:23 importlib-resources==1.5.0 10:59:23 iso8601==2.1.0 10:59:23 Jinja2==3.1.3 10:59:23 jmespath==1.0.1 10:59:23 jsonpatch==1.33 10:59:23 jsonpointer==2.4 10:59:23 jsonschema==4.21.0 10:59:23 jsonschema-specifications==2023.12.1 10:59:23 keystoneauth1==5.5.0 10:59:23 kubernetes==29.0.0 10:59:23 lftools==0.37.8 10:59:23 lxml==5.1.0 10:59:23 MarkupSafe==2.1.3 10:59:23 msgpack==1.0.7 10:59:23 multi_key_dict==2.0.3 10:59:23 munch==4.0.0 10:59:23 netaddr==0.10.1 10:59:23 netifaces==0.11.0 10:59:23 niet==1.4.2 10:59:23 nodeenv==1.8.0 10:59:23 oauth2client==4.1.3 10:59:23 oauthlib==3.2.2 10:59:23 openstacksdk==0.62.0 10:59:23 os-client-config==2.1.0 10:59:23 os-service-types==1.7.0 10:59:23 osc-lib==3.0.0 10:59:23 oslo.config==9.3.0 10:59:23 oslo.context==5.3.0 10:59:23 oslo.i18n==6.2.0 10:59:23 oslo.log==5.4.0 10:59:23 oslo.serialization==5.3.0 10:59:23 oslo.utils==7.0.0 10:59:23 packaging==23.2 10:59:23 pbr==6.0.0 10:59:23 platformdirs==4.1.0 10:59:23 prettytable==3.9.0 10:59:23 pyasn1==0.5.1 10:59:23 pyasn1-modules==0.3.0 10:59:23 pycparser==2.21 10:59:23 pygerrit2==2.0.15 10:59:23 PyGithub==2.1.1 10:59:23 pyinotify==0.9.6 10:59:23 PyJWT==2.8.0 10:59:23 PyNaCl==1.5.0 10:59:23 pyparsing==2.4.7 10:59:23 pyperclip==1.8.2 10:59:23 pyrsistent==0.20.0 10:59:23 python-cinderclient==9.4.0 10:59:23 python-dateutil==2.8.2 10:59:23 python-heatclient==3.4.0 10:59:23 python-jenkins==1.8.2 10:59:23 python-keystoneclient==5.3.0 10:59:23 python-magnumclient==4.3.0 10:59:23 python-novaclient==18.4.0 10:59:23 python-openstackclient==6.0.0 10:59:23 python-swiftclient==4.4.0 10:59:23 pytz==2023.3.post1 10:59:23 PyYAML==6.0.1 10:59:23 referencing==0.32.1 10:59:23 requests==2.31.0 10:59:23 requests-oauthlib==1.3.1 10:59:23 requestsexceptions==1.4.0 10:59:23 rfc3986==2.0.0 10:59:23 rpds-py==0.17.1 10:59:23 rsa==4.9 10:59:23 ruamel.yaml==0.18.5 10:59:23 ruamel.yaml.clib==0.2.8 10:59:23 s3transfer==0.10.0 10:59:23 simplejson==3.19.2 10:59:23 six==1.16.0 10:59:23 smmap==5.0.1 10:59:23 soupsieve==2.5 10:59:23 stevedore==5.1.0 10:59:23 tabulate==0.9.0 10:59:23 toml==0.10.2 10:59:23 tomlkit==0.12.3 10:59:23 tqdm==4.66.1 10:59:23 typing_extensions==4.9.0 10:59:23 tzdata==2023.4 10:59:23 urllib3==1.26.18 10:59:23 virtualenv==20.25.0 10:59:23 wcwidth==0.2.13 10:59:23 websocket-client==1.7.0 10:59:23 wrapt==1.16.0 10:59:23 xdg==6.0.0 10:59:23 xmltodict==0.13.0 10:59:23 yq==3.2.3 10:59:23 [EnvInject] - Injecting environment variables from a build step. 10:59:23 [EnvInject] - Injecting as environment variables the properties content 10:59:23 PYTHON=python3 10:59:23 10:59:23 [EnvInject] - Variables injected successfully. 10:59:23 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins9853401293670643368.sh 10:59:23 ---> tox-install.sh 10:59:23 + source /home/jenkins/lf-env.sh 10:59:23 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 10:59:23 ++ mktemp -d /tmp/venv-XXXX 10:59:23 + lf_venv=/tmp/venv-FUAn 10:59:23 + local venv_file=/tmp/.os_lf_venv 10:59:23 + local python=python3 10:59:23 + local options 10:59:23 + local set_path=true 10:59:23 + local install_args= 10:59:23 ++ 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 10:59:23 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 10:59:23 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 10:59:23 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 10:59:23 + true 10:59:23 + case $1 in 10:59:23 + venv_file=/tmp/.toxenv 10:59:23 + shift 2 10:59:23 + true 10:59:23 + case $1 in 10:59:23 + shift 10:59:23 + break 10:59:23 + case $python in 10:59:23 + local pkg_list= 10:59:23 + [[ -d /opt/pyenv ]] 10:59:23 + echo 'Setup pyenv:' 10:59:23 Setup pyenv: 10:59:23 + export PYENV_ROOT=/opt/pyenv 10:59:23 + PYENV_ROOT=/opt/pyenv 10:59:23 + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:23 + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:23 + pyenv versions 10:59:24 system 10:59:24 3.8.13 10:59:24 3.9.13 10:59:24 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:59:24 + command -v pyenv 10:59:24 ++ pyenv init - --no-rehash 10:59:24 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\''/opt/pyenv/shims'\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; fi; done; echo "${paths[*]}"'\'')" 10:59:24 export PATH="/opt/pyenv/shims:${PATH}" 10:59:24 export PYENV_SHELL=bash 10:59:24 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 10:59:24 pyenv() { 10:59:24 local command 10:59:24 command="${1:-}" 10:59:24 if [ "$#" -gt 0 ]; then 10:59:24 shift 10:59:24 fi 10:59:24 10:59:24 case "$command" in 10:59:24 rehash|shell) 10:59:24 eval "$(pyenv "sh-$command" "$@")" 10:59:24 ;; 10:59:24 *) 10:59:24 command pyenv "$command" "$@" 10:59:24 ;; 10:59:24 esac 10:59:24 }' 10:59:24 +++ bash --norc -ec 'IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; fi; done; echo "${paths[*]}"' 10:59:24 ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:24 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:24 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:24 ++ export PYENV_SHELL=bash 10:59:24 ++ PYENV_SHELL=bash 10:59:24 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 10:59:24 +++ complete -F _pyenv pyenv 10:59:24 ++ lf-pyver python3 10:59:24 ++ local py_version_xy=python3 10:59:24 ++ local py_version_xyz= 10:59:24 ++ pyenv versions 10:59:24 ++ local command 10:59:24 ++ command=versions 10:59:24 ++ '[' 1 -gt 0 ']' 10:59:24 ++ shift 10:59:24 ++ case "$command" in 10:59:24 ++ command pyenv versions 10:59:24 ++ pyenv versions 10:59:24 ++ grep -E '^[0-9.]*[0-9]$' 10:59:24 ++ sed 's/^[ *]* //' 10:59:24 ++ awk '{ print $1 }' 10:59:24 ++ [[ ! -s /tmp/.pyenv_versions ]] 10:59:24 +++ grep '^3' /tmp/.pyenv_versions 10:59:24 +++ sort -V 10:59:24 +++ tail -n 1 10:59:24 ++ py_version_xyz=3.10.6 10:59:24 ++ [[ -z 3.10.6 ]] 10:59:24 ++ echo 3.10.6 10:59:24 ++ return 0 10:59:24 + pyenv local 3.10.6 10:59:24 + local command 10:59:24 + command=local 10:59:24 + '[' 2 -gt 0 ']' 10:59:24 + shift 10:59:24 + case "$command" in 10:59:24 + command pyenv local 3.10.6 10:59:24 + pyenv local 3.10.6 10:59:24 + for arg in "$@" 10:59:24 + case $arg in 10:59:24 + pkg_list+='tox ' 10:59:24 + for arg in "$@" 10:59:24 + case $arg in 10:59:24 + pkg_list+='virtualenv ' 10:59:24 + for arg in "$@" 10:59:24 + case $arg in 10:59:24 + pkg_list+='urllib3~=1.26.15 ' 10:59:24 + [[ -f /tmp/.toxenv ]] 10:59:24 + [[ ! -f /tmp/.toxenv ]] 10:59:24 + [[ -n '' ]] 10:59:24 + python3 -m venv /tmp/venv-FUAn 10:59:27 + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-FUAn' 10:59:27 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-FUAn 10:59:27 + echo /tmp/venv-FUAn 10:59:27 + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' 10:59:27 lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv 10:59:27 + /tmp/venv-FUAn/bin/python3 -m pip install --upgrade --quiet pip virtualenv 10:59:31 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 10:59:31 + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' 10:59:31 lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 10:59:31 + /tmp/venv-FUAn/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 10:59:34 + type python3 10:59:34 + true 10:59:34 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-FUAn/bin to PATH' 10:59:34 lf-activate-venv(): INFO: Adding /tmp/venv-FUAn/bin to PATH 10:59:34 + PATH=/tmp/venv-FUAn/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:34 + return 0 10:59:34 + python3 --version 10:59:34 Python 3.10.6 10:59:34 + python3 -m pip --version 10:59:35 pip 23.3.2 from /tmp/venv-FUAn/lib/python3.10/site-packages/pip (python 3.10) 10:59:35 + python3 -m pip freeze 10:59:35 cachetools==5.3.2 10:59:35 chardet==5.2.0 10:59:35 colorama==0.4.6 10:59:35 distlib==0.3.8 10:59:35 filelock==3.13.1 10:59:35 packaging==23.2 10:59:35 platformdirs==4.1.0 10:59:35 pluggy==1.3.0 10:59:35 pyproject-api==1.6.1 10:59:35 tomli==2.0.1 10:59:35 tox==4.12.1 10:59:35 urllib3==1.26.18 10:59:35 virtualenv==20.25.0 10:59:35 [transportpce-tox-verify-transportpce-master] $ /bin/sh -xe /tmp/jenkins13093481911163536992.sh 10:59:35 [EnvInject] - Injecting environment variables from a build step. 10:59:35 [EnvInject] - Injecting as environment variables the properties content 10:59:35 PARALLEL=True 10:59:35 10:59:35 [EnvInject] - Variables injected successfully. 10:59:35 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins10492624572141467109.sh 10:59:35 ---> tox-run.sh 10:59:35 + PATH=/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 + ARCHIVE_TOX_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 10:59:35 + ARCHIVE_DOC_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 10:59:35 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 10:59:35 + cd /w/workspace/transportpce-tox-verify-transportpce-master/. 10:59:35 + source /home/jenkins/lf-env.sh 10:59:35 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 10:59:35 ++ mktemp -d /tmp/venv-XXXX 10:59:35 + lf_venv=/tmp/venv-vtpI 10:59:35 + local venv_file=/tmp/.os_lf_venv 10:59:35 + local python=python3 10:59:35 + local options 10:59:35 + local set_path=true 10:59:35 + local install_args= 10:59:35 ++ getopt -o np:v: -l no-path,system-site-packages,python:,venv-file: -n lf-activate-venv -- --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 10:59:35 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 10:59:35 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 10:59:35 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 10:59:35 + true 10:59:35 + case $1 in 10:59:35 + venv_file=/tmp/.toxenv 10:59:35 + shift 2 10:59:35 + true 10:59:35 + case $1 in 10:59:35 + shift 10:59:35 + break 10:59:35 + case $python in 10:59:35 + local pkg_list= 10:59:35 + [[ -d /opt/pyenv ]] 10:59:35 + echo 'Setup pyenv:' 10:59:35 Setup pyenv: 10:59:35 + export PYENV_ROOT=/opt/pyenv 10:59:35 + PYENV_ROOT=/opt/pyenv 10:59:35 + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 + pyenv versions 10:59:35 system 10:59:35 3.8.13 10:59:35 3.9.13 10:59:35 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 10:59:35 + command -v pyenv 10:59:35 ++ pyenv init - --no-rehash 10:59:35 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\''/opt/pyenv/shims'\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; fi; done; echo "${paths[*]}"'\'')" 10:59:35 export PATH="/opt/pyenv/shims:${PATH}" 10:59:35 export PYENV_SHELL=bash 10:59:35 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 10:59:35 pyenv() { 10:59:35 local command 10:59:35 command="${1:-}" 10:59:35 if [ "$#" -gt 0 ]; then 10:59:35 shift 10:59:35 fi 10:59:35 10:59:35 case "$command" in 10:59:35 rehash|shell) 10:59:35 eval "$(pyenv "sh-$command" "$@")" 10:59:35 ;; 10:59:35 *) 10:59:35 command pyenv "$command" "$@" 10:59:35 ;; 10:59:35 esac 10:59:35 }' 10:59:35 +++ bash --norc -ec 'IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; fi; done; echo "${paths[*]}"' 10:59:35 ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:35 ++ export PYENV_SHELL=bash 10:59:35 ++ PYENV_SHELL=bash 10:59:35 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 10:59:35 +++ complete -F _pyenv pyenv 10:59:35 ++ lf-pyver python3 10:59:35 ++ local py_version_xy=python3 10:59:35 ++ local py_version_xyz= 10:59:35 ++ pyenv versions 10:59:35 ++ local command 10:59:35 ++ command=versions 10:59:35 ++ '[' 1 -gt 0 ']' 10:59:35 ++ shift 10:59:35 ++ case "$command" in 10:59:35 ++ command pyenv versions 10:59:35 ++ pyenv versions 10:59:35 ++ sed 's/^[ *]* //' 10:59:35 ++ awk '{ print $1 }' 10:59:35 ++ grep -E '^[0-9.]*[0-9]$' 10:59:35 ++ [[ ! -s /tmp/.pyenv_versions ]] 10:59:35 +++ grep '^3' /tmp/.pyenv_versions 10:59:35 +++ tail -n 1 10:59:35 +++ sort -V 10:59:35 ++ py_version_xyz=3.10.6 10:59:35 ++ [[ -z 3.10.6 ]] 10:59:35 ++ echo 3.10.6 10:59:35 ++ return 0 10:59:35 + pyenv local 3.10.6 10:59:35 + local command 10:59:35 + command=local 10:59:35 + '[' 2 -gt 0 ']' 10:59:35 + shift 10:59:35 + case "$command" in 10:59:35 + command pyenv local 3.10.6 10:59:35 + pyenv local 3.10.6 10:59:35 + for arg in "$@" 10:59:35 + case $arg in 10:59:35 + pkg_list+='tox ' 10:59:35 + for arg in "$@" 10:59:35 + case $arg in 10:59:35 + pkg_list+='virtualenv ' 10:59:35 + for arg in "$@" 10:59:35 + case $arg in 10:59:35 + pkg_list+='urllib3~=1.26.15 ' 10:59:35 + [[ -f /tmp/.toxenv ]] 10:59:35 ++ cat /tmp/.toxenv 10:59:35 + lf_venv=/tmp/venv-FUAn 10:59:35 + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-FUAn from' file:/tmp/.toxenv 10:59:35 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-FUAn from file:/tmp/.toxenv 10:59:35 + /tmp/venv-FUAn/bin/python3 -m pip install --upgrade --quiet pip virtualenv 10:59:36 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 10:59:36 + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' 10:59:36 lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 10:59:36 + /tmp/venv-FUAn/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 10:59:38 + type python3 10:59:38 + true 10:59:38 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-FUAn/bin to PATH' 10:59:38 lf-activate-venv(): INFO: Adding /tmp/venv-FUAn/bin to PATH 10:59:38 + PATH=/tmp/venv-FUAn/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:38 + return 0 10:59:38 + [[ -d /opt/pyenv ]] 10:59:38 + echo '---> Setting up pyenv' 10:59:38 ---> Setting up pyenv 10:59:38 + export PYENV_ROOT=/opt/pyenv 10:59:38 + PYENV_ROOT=/opt/pyenv 10:59:38 + export PATH=/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:38 + PATH=/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin 10:59:38 ++ pwd 10:59:38 + PYTHONPATH=/w/workspace/transportpce-tox-verify-transportpce-master 10:59:38 + export PYTHONPATH 10:59:38 + export TOX_TESTENV_PASSENV=PYTHONPATH 10:59:38 + TOX_TESTENV_PASSENV=PYTHONPATH 10:59:38 + tox --version 10:59:38 4.12.1 from /tmp/venv-FUAn/lib/python3.10/site-packages/tox/__init__.py 10:59:38 + PARALLEL=True 10:59:38 + TOX_OPTIONS_LIST= 10:59:38 + [[ -n '' ]] 10:59:38 + case ${PARALLEL,,} in 10:59:38 + TOX_OPTIONS_LIST=' --parallel auto --parallel-live' 10:59:38 + tox --parallel auto --parallel-live 10:59:38 + tee -a /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tox.log 10:59:41 docs: install_deps> python -I -m pip install -r docs/requirements.txt 10:59:41 docs-linkcheck: install_deps> python -I -m pip install -r docs/requirements.txt 10:59:41 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 10:59:41 checkbashisms: freeze> python -m pip freeze --all 10:59:42 checkbashisms: pip==23.3.1,setuptools==69.0.2,wheel==0.42.0 10:59:42 checkbashisms: commands[0] /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)' 10:59:42 /usr/bin/sh: checkbashisms: command not found 10:59:43 CentOS Stream 8 - AppStream 41 MB/s | 26 MB 00:00 10:59:49 buildcontroller: freeze> python -m pip freeze --all 10:59:49 buildcontroller: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 10:59:49 buildcontroller: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_controller.sh 10:59:49 which: no mvn in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/buildcontroller/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 10:59:49 + JAVA_CMD=java 10:59:49 + '[' -n '' ']' 10:59:49 ++ java -version 10:59:49 ++ sed -n ';s/.* version "\(.*\)\.\(.*\)\..*".*$/\1/p;' 10:59:49 + JAVA_VER=11 10:59:49 11 10:59:49 + echo 11 10:59:49 + JAVAC_CMD=javac 10:59:49 + '[' -n '' ']' 10:59:49 ++ sed -n ';s/javac \(.*\)\.\(.*\)\..*.*$/\1/p;' 10:59:49 ++ javac -version 10:59:52 + JAVAC_VER=11 10:59:52 11 10:59:52 install java 17 10:59:52 + echo 11 10:59:52 + '[' 11 -ge 17 -a 11 -ge 17 ']' 10:59:52 + echo 'install java 17' 10:59:52 + sudo yum install -y java-17-openjdk java-17-openjdk-devel 10:59:52 Waiting for process with pid 6898 to finish. 11:00:09 CentOS Stream 8 - BaseOS 508 kB/s | 10 MB 00:20 11:00:27 CentOS Stream 8 - Extras 1.1 kB/s | 18 kB 00:16 11:00:28 CentOS Stream 8 - Extras common packages 88 kB/s | 6.9 kB 00:00 11:00:30 CentOS Stream 8 - PowerTools 1.8 MB/s | 4.7 MB 00:02 11:00:32 Docker CE Stable - x86_64 605 kB/s | 52 kB 00:00 11:00:32 Extra Packages for Enterprise Linux 8 - x86_64 34 MB/s | 16 MB 00:00 11:00:37 Node.js Packages for Enterprise Linux 8 - x86_6 1.6 MB/s | 710 kB 00:00 11:00:38 Puppet Repository el 8 - x86_64 31 MB/s | 19 MB 00:00 11:00:41 docs: freeze> python -m pip freeze --all 11:00:41 docs-linkcheck: freeze> python -m pip freeze --all 11:00:42 docs-linkcheck: alabaster==0.7.16,attrs==23.2.0,Babel==2.14.0,blockdiag==3.0.0,certifi==2023.11.17,charset-normalizer==3.3.2,contourpy==1.2.0,cycler==0.12.1,docutils==0.18.1,fonttools==4.47.2,funcparserlib==2.0.0a0,future==0.18.3,idna==3.6,imagesize==1.4.1,Jinja2==3.1.3,jsonschema==3.2.0,kiwisolver==1.4.5,lfdocs-conf==0.9.0,MarkupSafe==2.1.3,matplotlib==3.8.2,numpy==1.26.3,nwdiag==3.0.0,packaging==23.2,pillow==10.2.0,pip==23.3.1,Pygments==2.17.2,pyparsing==3.1.1,pyrsistent==0.20.0,python-dateutil==2.8.2,PyYAML==6.0.1,requests==2.31.0,requests-file==1.5.1,seqdiag==3.0.0,setuptools==69.0.2,six==1.16.0,snowballstemmer==2.2.0,Sphinx==7.2.6,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.2,sphinx-rtd-theme==2.0.0,sphinx-tabs==3.4.4,sphinxcontrib-applehelp==1.0.8,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==1.0.6,sphinxcontrib-htmlhelp==2.0.5,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.27,sphinxcontrib-qthelp==1.0.7,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==1.1.10,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.1.0,webcolors==1.13,wheel==0.42.0 11:00:42 docs-linkcheck: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sphinx-build -q -b linkcheck -d /w/workspace/transportpce-tox-verify-transportpce-master/.tox/docs-linkcheck/tmp/doctrees ../docs/ /w/workspace/transportpce-tox-verify-transportpce-master/docs/_build/linkcheck 11:00:42 docs: alabaster==0.7.16,attrs==23.2.0,Babel==2.14.0,blockdiag==3.0.0,certifi==2023.11.17,charset-normalizer==3.3.2,contourpy==1.2.0,cycler==0.12.1,docutils==0.18.1,fonttools==4.47.2,funcparserlib==2.0.0a0,future==0.18.3,idna==3.6,imagesize==1.4.1,Jinja2==3.1.3,jsonschema==3.2.0,kiwisolver==1.4.5,lfdocs-conf==0.9.0,MarkupSafe==2.1.3,matplotlib==3.8.2,numpy==1.26.3,nwdiag==3.0.0,packaging==23.2,pillow==10.2.0,pip==23.3.1,Pygments==2.17.2,pyparsing==3.1.1,pyrsistent==0.20.0,python-dateutil==2.8.2,PyYAML==6.0.1,requests==2.31.0,requests-file==1.5.1,seqdiag==3.0.0,setuptools==69.0.2,six==1.16.0,snowballstemmer==2.2.0,Sphinx==7.2.6,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.2,sphinx-rtd-theme==2.0.0,sphinx-tabs==3.4.4,sphinxcontrib-applehelp==1.0.8,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==1.0.6,sphinxcontrib-htmlhelp==2.0.5,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.27,sphinxcontrib-qthelp==1.0.7,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==1.1.10,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.1.0,webcolors==1.13,wheel==0.42.0 11:00:42 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 11:00:43 Last metadata expiration check: 0:00:05 ago on Fri 19 Jan 2024 11:00:38 AM UTC. 11:00:44 docs: OK ✔ in 1 minute 4.66 seconds 11:00:44 pre-commit: install_deps> python -I -m pip install pre-commit 11:00:45 docs-linkcheck: OK ✔ in 1 minute 5.76 seconds 11:00:45 pylint: install_deps> python -I -m pip install 'pylint>=2.6.0' 11:00:46 No match for argument: devscripts-checkbashisms 11:00:46 Error: Unable to find a match: devscripts-checkbashisms 11:00:46 Package java-17-openjdk-1:17.0.6.0.9-0.3.ea.el8.x86_64 is already installed. 11:00:46 Package java-17-openjdk-devel-1:17.0.6.0.9-0.3.ea.el8.x86_64 is already installed. 11:00:46 Dependencies resolved. 11:00:46 Nothing to do. 11:00:46 Complete! 11:00:46 ++ ls -tr1 /usr/lib/jvm/ 11:00:46 ++ tail -1 11:00:46 ++ grep java-17-openjdk-17 11:00:46 + last_installed_jdk17=java-17-openjdk-17.0.6.0.9-0.3.ea.el8.x86_64 11:00:46 + '[' -n java-17-openjdk-17.0.6.0.9-0.3.ea.el8.x86_64 ']' 11:00:46 + sudo alternatives --set java /usr/lib/jvm/java-17-openjdk-17.0.6.0.9-0.3.ea.el8.x86_64/bin/java 11:00:46 + sudo alternatives --set javac /usr/lib/jvm/java-17-openjdk-17.0.6.0.9-0.3.ea.el8.x86_64/bin/javac 11:00:46 + wget -nv https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz -P /tmp 11:00:47 2024-01-19 11:00:47 URL:https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz [8296049/8296049] -> "/tmp/apache-maven-3.8.8-bin.tar.gz" [1] 11:00:47 + sudo mkdir -p /opt 11:00:47 + sudo tar xf /tmp/apache-maven-3.8.8-bin.tar.gz -C /opt 11:00:47 Last metadata expiration check: 0:00:09 ago on Fri 19 Jan 2024 11:00:38 AM UTC. 11:00:47 + sudo ln -s /opt/apache-maven-3.8.8 /opt/maven 11:00:47 + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn 11:00:47 pre-commit: freeze> python -m pip freeze --all 11:00:47 NOTE: Picked up JDK_JAVA_OPTIONS: 11:00:47 --add-opens=java.base/java.io=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.lang=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.net=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.nio=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.nio.file=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.util=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.util.jar=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.util.stream=ALL-UNNAMED 11:00:47 --add-opens=java.base/java.util.zip=ALL-UNNAMED 11:00:47 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 11:00:47 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 11:00:47 -Xlog:disable 11:00:47 pre-commit: cfgv==3.4.0,distlib==0.3.8,filelock==3.13.1,identify==2.5.33,nodeenv==1.8.0,pip==23.3.1,platformdirs==4.1.0,pre-commit==3.6.0,PyYAML==6.0.1,setuptools==69.0.2,virtualenv==20.25.0,wheel==0.42.0 11:00:47 pre-commit: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run --all-files --show-diff-on-failure 11:00:48 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 11:00:48 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. 11:00:48 pylint: freeze> python -m pip freeze --all 11:00:49 No match for argument: devscripts-minimal 11:00:49 Error: Unable to find a match: devscripts-minimal 11:00:49 pylint: astroid==3.0.2,dill==0.3.7,isort==5.13.2,mccabe==0.7.0,pip==23.3.1,platformdirs==4.1.0,pylint==3.0.3,setuptools==69.0.2,tomli==2.0.1,tomlkit==0.12.3,typing_extensions==4.9.0,wheel==0.42.0 11:00:49 pylint: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find transportpce_tests/ -name '*.py' -exec pylint --fail-under=10 --max-line-length=120 --disable=missing-docstring,import-error --disable=fixme --disable=duplicate-code '--module-rgx=([a-z0-9_]+$)|([0-9.]{1,30}$)' '--method-rgx=(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$' '--variable-rgx=[a-zA-Z_][a-zA-Z0-9_]{1,30}$' '{}' + 11:00:49 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. 11:00:49 Last metadata expiration check: 0:00:11 ago on Fri 19 Jan 2024 11:00:38 AM UTC. 11:00:50 [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. 11:00:51 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-autopep8. 11:00:51 No match for argument: devscripts 11:00:51 Error: Unable to find a match: devscripts 11:00:51 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 11:00:51 [INFO] Once installed this environment will be reused. 11:00:51 [INFO] This may take a few minutes... 11:00:52 Last metadata expiration check: 0:00:14 ago on Fri 19 Jan 2024 11:00:38 AM UTC. 11:00:55 devscripts-checkbashisms-2.19.6-2.fc31.x86_64.r 311 kB/s | 29 kB 00:00 11:00:55 Dependencies resolved. 11:00:55 ================================================================================ 11:00:55 Package Arch Version Repository Size 11:00:55 ================================================================================ 11:00:55 Installing: 11:00:55 devscripts-checkbashisms x86_64 2.19.6-2.fc31 @commandline 29 k 11:00:55 11:00:55 Transaction Summary 11:00:55 ================================================================================ 11:00:55 Install 1 Package 11:00:55 11:00:55 Total size: 29 k 11:00:55 Installed size: 52 k 11:00:55 Downloading Packages: 11:00:55 Running transaction check 11:00:55 Transaction check succeeded. 11:00:55 Running transaction test 11:00:56 Transaction test succeeded. 11:00:56 Running transaction 11:00:56 Preparing : 1/1 11:00:56 Installing : devscripts-checkbashisms-2.19.6-2.fc31.x86_64 1/1 11:00:56 Running scriptlet: devscripts-checkbashisms-2.19.6-2.fc31.x86_64 1/1 11:00:57 Verifying : devscripts-checkbashisms-2.19.6-2.fc31.x86_64 1/1[INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. 11:00:57 [INFO] Once installed this environment will be reused. 11:00:57 [INFO] This may take a few minutes... 11:00:57 11:00:57 11:00:57 Installed: 11:00:57 devscripts-checkbashisms-2.19.6-2.fc31.x86_64 11:00:57 11:00:57 Complete! 11:00:57 checkbashisms: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find . -not -path '*/\.*' -name '*.sh' -exec checkbashisms -f '{}' + 11:00:58 script ./reflectwarn.sh does not appear to have a #! interpreter line; 11:00:58 you may get strange results 11:01:05 [INFO] Installing environment for https://github.com/pre-commit/mirrors-autopep8. 11:01:05 [INFO] Once installed this environment will be reused. 11:01:05 [INFO] This may take a few minutes... 11:01:08 trim trailing whitespace.................................................Passed 11:01:08 Tabs remover.............................................................Passed 11:01:08 autopep8.................................................................************* Module test01_abstracted_topology 11:01:12 transportpce_tests/tapi/test01_abstracted_topology.py:23:0: W0611: Unused ResponseError imported from xmlrpc.client (unused-import) 11:01:12 11:01:12 ------------------------------------ 11:01:12 Your code has been rated at 10.00/10 11:01:12 11:01:13 Passed 11:01:13 checkbashisms: OK ✔ in 1 minute 19.06 seconds 11:01:13 pre-commit: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run gitlint-ci --hook-stage manual 11:01:13 [INFO] Installing environment for https://github.com/jorisroovers/gitlint. 11:01:13 [INFO] Once installed this environment will be reused. 11:01:13 [INFO] This may take a few minutes... 11:01:14 pylint: exit 1 (24.57 seconds) /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}$' '{}' + pid=7380 11:01:20 gitlint..................................................................Passed 11:02:53 pylint: FAIL ✖ in 28.98 seconds 11:02:53 pre-commit: OK ✔ in 36.96 seconds 11:02:53 buildcontroller: OK ✔ in 3 minutes 13.28 seconds 11:02:53 sims121: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 11:02:53 sims221: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 11:02:53 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 11:02:53 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 11:03:01 sims221: freeze> python -m pip freeze --all 11:03:01 build_karaf_tests121: freeze> python -m pip freeze --all 11:03:01 sims121: freeze> python -m pip freeze --all 11:03:01 sims221: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:01 sims221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_sims.sh 2.2.1 11:03:01 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 11:03:02 build_karaf_tests121: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:02 build_karaf_tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 11:03:02 NOTE: Picked up JDK_JAVA_OPTIONS: 11:03:02 --add-opens=java.base/java.io=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.lang=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.net=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.nio=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.nio.file=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.util=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.util.jar=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.util.stream=ALL-UNNAMED 11:03:02 --add-opens=java.base/java.util.zip=ALL-UNNAMED 11:03:02 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 11:03:02 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 11:03:02 -Xlog:disable 11:03:02 sims121: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:02 sims121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_sims.sh 1.2.1 11:03:02 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 11:03:05 sims121: OK ✔ in 12.84 seconds 11:03:05 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 11:03:05 unzip: cannot find or open ./lightynode/artifact.zip, ./lightynode/artifact.zip.zip or ./lightynode/artifact.zip.ZIP. 11:03:05 mv: cannot stat './lightynode/lighty-openroadm-device-18.1.0.8': No such file or directory 11:03:06 sims221: OK ✔ in 13.43 seconds 11:03:06 sims71: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 11:03:19 sims71: freeze> python -m pip freeze --all 11:03:19 build_karaf_tests221: freeze> python -m pip freeze --all 11:03:19 sims71: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:19 sims71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_sims.sh 7.1 11:03:19 Removing ./lightynode/lightynode-openroadm-device directory 11:03:19 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 11:03:19 build_karaf_tests221: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:19 build_karaf_tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 11:03:19 NOTE: Picked up JDK_JAVA_OPTIONS: 11:03:19 --add-opens=java.base/java.io=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.lang=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.net=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.nio=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.nio.file=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.util=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.util.jar=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.util.stream=ALL-UNNAMED 11:03:19 --add-opens=java.base/java.util.zip=ALL-UNNAMED 11:03:19 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 11:03:19 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 11:03:19 -Xlog:disable 11:03:23 sims71: OK ✔ in 16.9 seconds 11:03:23 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 11:03:42 build_karaf_tests121: OK ✔ in 49.64 seconds 11:03:42 build_karaf_tests_hybrid: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 11:03:44 build_karaf_tests71: freeze> python -m pip freeze --all 11:03:45 build_karaf_tests71: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:45 build_karaf_tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 11:03:45 NOTE: Picked up JDK_JAVA_OPTIONS: 11:03:45 --add-opens=java.base/java.io=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.lang=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.net=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.nio=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.nio.file=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.util=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.util.jar=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.util.stream=ALL-UNNAMED 11:03:45 --add-opens=java.base/java.util.zip=ALL-UNNAMED 11:03:45 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 11:03:45 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 11:03:45 -Xlog:disable 11:03:51 build_karaf_tests_hybrid: freeze> python -m pip freeze --all 11:03:52 build_karaf_tests_hybrid: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:03:52 build_karaf_tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 11:03:52 NOTE: Picked up JDK_JAVA_OPTIONS: 11:03:52 --add-opens=java.base/java.io=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.lang=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.net=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.nio=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.nio.file=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.util=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.util.jar=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.util.stream=ALL-UNNAMED 11:03:52 --add-opens=java.base/java.util.zip=ALL-UNNAMED 11:03:52 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 11:03:52 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 11:03:52 -Xlog:disable 11:04:21 build_karaf_tests221: OK ✔ in 1 minute 16.03 seconds 11:04:21 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 11:04:24 testsPCE: freeze> python -m pip freeze --all 11:04:24 testsPCE: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,click==8.1.7,contourpy==1.2.0,cryptography==3.3.2,cycler==0.12.1,dict2xml==1.7.4,exceptiongroup==1.2.0,Flask==2.1.3,Flask-Injector==0.14.0,fonttools==4.47.2,gnpy4tpce==2.4.7,idna==3.6,iniconfig==2.0.0,injector==0.21.0,itsdangerous==2.1.2,Jinja2==3.1.3,kiwisolver==1.4.5,lxml==4.9.4,MarkupSafe==2.1.3,matplotlib==3.8.2,netconf-client==2.5.0,networkx==2.8.8,numpy==1.26.3,packaging==23.2,pandas==1.5.3,paramiko==3.4.0,pbr==5.11.1,pillow==10.2.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pyparsing==3.1.1,pytest==7.4.4,python-dateutil==2.8.2,pytz==2023.3.post1,requests==2.31.0,scipy==1.11.4,setuptools==50.3.2,six==1.16.0,tomli==2.0.1,urllib3==2.1.0,Werkzeug==2.0.3,wheel==0.42.0,xlrd==1.2.0 11:04:24 testsPCE: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce 11:04:24 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/testsPCE/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 11:04:24 pytest -q transportpce_tests/pce/test01_pce.py 11:04:32 build_karaf_tests71: OK ✔ in 1 minute 6.69 seconds 11:04:32 tests_tapi: freeze> python -m pip freeze --all 11:04:32 tests_tapi: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:04:32 tests_tapi: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh tapi 11:04:32 using environment variables from ./karaf221.env 11:04:32 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/tests_tapi/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 11:04:32 pytest -q transportpce_tests/tapi/test01_abstracted_topology.py 11:05:24 .................................... [100%] 11:06:29 20 passed in 124.13s (0:02:04) 11:06:29 pytest -q transportpce_tests/pce/test02_pce_400G.py 11:06:30 ......................... [100%] 11:07:16 9 passed in 46.43s 11:07:16 pytest -q transportpce_tests/pce/test03_gnpy.py 11:07:24 .............. [100%] 11:07:56 8 passed in 40.00s 11:07:56 pytest -q transportpce_tests/pce/test04_pce_bug_fix.py 11:08:08 ............ [100%] 11:08:15 50 passed in 222.34s (0:03:42) 11:08:15 pytest -q transportpce_tests/tapi/test02_full_topology.py 11:08:33 ... [100%] 11:08:39 3 passed in 43.22s 11:08:40 build_karaf_tests_hybrid: OK ✔ in 1 minute 12.41 seconds 11:08:40 testsPCE: OK ✔ in 5 minutes 47.35 seconds 11:08:40 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 11:08:46 tests121: freeze> python -m pip freeze --all 11:08:47 tests121: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:08:47 tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 11:08:47 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/tests121/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 11:08:47 using environment variables from ./karaf121.env 11:08:47 pytest -q transportpce_tests/1.2.1/test01_portmapping.py 11:09:46 ....................................... [100%] 11:13:17 30 passed in 300.60s (0:05:00) 11:13:17 pytest -q transportpce_tests/tapi/test03_tapi_device_change_notifications.py 11:13:17 ............ [100%] 11:13:30 21 passed in 283.31s (0:04:43) 11:13:31 pytest -q transportpce_tests/1.2.1/test02_topo_portmapping.py 11:14:34 .................................................................... [100%] 11:17:29 6 passed in 238.74s (0:03:58) 11:17:30 pytest -q transportpce_tests/1.2.1/test03_topology.py 11:17:55 ........ [100%] 11:18:09 70 passed in 292.65s (0:04:52) 11:18:09 tests_tapi: OK ✔ in 13 minutes 48.03 seconds 11:18:09 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 11:18:17 tests71: freeze> python -m pip freeze --all 11:18:17 tests71: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:18:17 tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_honeynode.sh 7.1 11:18:17 Installing honeynode for 7.1 devices to ./honeynode/7.1/honeynode-simulator directory 11:18:18 tests71: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 7.1 11:18:18 using environment variables from ./karaf71.env 11:18:18 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/tests71/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 11:18:18 pytest -q transportpce_tests/7.1/test01_portmapping.py 11:18:58 ............ [100%] 11:19:12 12 passed in 53.74s 11:19:12 pytest -q transportpce_tests/7.1/test02_otn_renderer.py 11:19:47 .......................................................................... [100%] 11:22:05 62 passed in 173.57s (0:02:53) 11:22:05 pytest -q transportpce_tests/7.1/test03_renderer_or_modes.py 11:22:56 ........................................................ [100%] 11:24:47 48 passed in 161.17s (0:02:41) 11:24:47 pytest -q transportpce_tests/7.1/test04_renderer_regen_mode.py 11:25:24 ...................... [100%] 11:26:15 22 passed in 87.98s (0:01:27) 11:26:15 tests71: OK ✔ in 8 minutes 6.17 seconds 11:26:15 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 11:26:22 tests221: freeze> python -m pip freeze --all 11:26:22 tests221: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.1,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.2,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 11:26:22 tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 11:26:22 using environment variables from ./karaf221.env 11:26:22 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/tests221/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 11:26:22 pytest -q transportpce_tests/2.2.1/test01_portmapping.py 11:26:57 ................................... [100%] 11:27:37 35 passed in 74.45s (0:01:14) 11:27:37 pytest -q transportpce_tests/2.2.1/test02_topo_portmapping.py 11:27:47 ....................... [100%] 11:28:22 6 passed in 44.62s 11:28:22 pytest -q transportpce_tests/2.2.1/test03_topology.py 11:28:23 ....... [100%] 11:28:39 44 passed in 668.87s (0:11:08) 11:28:39 pytest -q transportpce_tests/1.2.1/test04_renderer_service_path_nominal.py 11:29:15 ............................................ [100%] 11:30:51 44 passed in 148.89s (0:02:28) 11:30:51 pytest -q transportpce_tests/2.2.1/test04_otn_topology.py 11:31:26 ............ [100%] 11:31:50 12 passed in 59.25s 11:31:50 pytest -q transportpce_tests/2.2.1/test05_flex_grid.py 11:32:16 ................................. [100%] 11:33:14 24 passed in 275.22s (0:04:35) 11:33:14 pytest -q transportpce_tests/1.2.1/test05_olm.py 11:33:17 ....... [100%] 11:33:47 16 passed in 116.20s (0:01:56) 11:33:47 pytest -q transportpce_tests/2.2.1/test06_renderer_service_path_nominal.py 11:33:49 ............................................... [100%] 11:34:31 31 passed in 43.52s 11:34:31 pytest -q transportpce_tests/2.2.1/test07_otn_renderer.py 11:34:40 ............................................ [100%] 11:36:05 26 passed in 94.05s (0:01:34) 11:36:05 pytest -q transportpce_tests/2.2.1/test08_otn_sh_renderer.py 11:36:07 ...... [100%] 11:36:22 40 passed in 188.09s (0:03:08) 11:36:23 pytest -q transportpce_tests/1.2.1/test06_end2end.py 11:36:50 .......................................... [100%] 11:37:58 22 passed in 112.35s (0:01:52) 11:37:58 pytest -q transportpce_tests/2.2.1/test09_olm.py 11:37:59 ................................................................ [100%] 11:41:01 40 passed in 183.56s (0:03:03) 11:41:01 pytest -q transportpce_tests/2.2.1/test11_otn_end2end.py 11:41:02 ............................................................... [100%] 11:45:28 54 passed in 545.10s (0:09:05) 11:45:35 ................... [ 74%] 11:47:19 ......................... [100%] 11:49:12 97 passed in 490.25s (0:08:10) 11:49:12 pytest -q transportpce_tests/2.2.1/test12_end2end.py 11:49:47 ...................................................... [100%] 11:56:36 54 passed in 443.90s (0:07:23) 11:56:36 pytest -q transportpce_tests/2.2.1/test14_otn_switch_end2end.py 11:57:27 ........................................................................ [ 71%] 12:02:40 ............................. [100%] 12:04:50 101 passed in 494.12s (0:08:14) 12:04:50 pytest -q transportpce_tests/2.2.1/test15_otn_end2end_with_intermediate_switch.py 12:05:38 ........................................................................ [ 67%] 12:11:28 ................................... [100%] 12:14:50 107 passed in 599.14s (0:09:59) 12:14:50 tests121: OK ✔ in 36 minutes 48.52 seconds 12:14:50 tests221: OK ✔ in 48 minutes 34.69 seconds 12:14:50 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 12:14:56 tests_hybrid: freeze> python -m pip freeze --all 12:14:57 tests_hybrid: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.2,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.3,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 12:14:57 tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_honeynode.sh 12:14:57 Installing honeynode for 1.2.1 devices to ./honeynode/1.2.1/honeynode-simulator directory 12:14:58 Installing honeynode for 2.2.1 devices to ./honeynode/2.2.1/honeynode-simulator directory 12:14:59 Removing ./honeynode/7.1/honeynode-simulator directory 12:14:59 Installing honeynode for 7.1 devices to ./honeynode/7.1/honeynode-simulator directory 12:15:00 tests_hybrid: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid 12:15:00 using environment variables from ./karaf121.env 12:15:00 which: no pytest-3 in (/w/workspace/transportpce-tox-verify-transportpce-master/.tox/tests_hybrid/bin:/opt/pyenv/bin:/tmp/venv-FUAn/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/home/jenkins/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin) 12:15:00 pytest -q transportpce_tests/hybrid/test01_device_change_notifications.py 12:16:12 FFFFFFFFFFFF.FFF.FFF.FF.FFF.FF.FFF.FF.FFF.FFFFFFFFF [100%] 12:16:44 =================================== FAILURES =================================== 12:16:44 ________________ TransportPCEFulltesting.test_01_connect_xpdrA _________________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 12:16:44 body = '{"node": [{"node-id": "XPDRA01", "netconf-node-topology:username": "admin", "netconf-node-topology:password": "admin"...f-node-topology:port": "17830", "netconf-node-topology:tcp-only": "false", "netconf-node-topology:pass-through": {}}]}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '287', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 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) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_01_connect_xpdrA(self): 12:16:44 > response = test_utils.mount_device("XPDRA01", ('xpdra', self.NODE_VERSION_121)) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:96: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:337: in mount_device 12:16:44 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ---------------------------- Captured stdout setup ----------------------------- 12:16:44 starting OpenDaylight... 12:16:44 starting KARAF TransportPCE build... 12:16:44 Searching for pattern 'Transportpce controller started' in karaf.log... Pattern found! OpenDaylight started ! 12:16:44 starting simulator xpdra in OpenROADM device version 1.2.1... 12:16:44 Searching for pattern 'Netconf SSH endpoint started successfully at 0.0.0.0' in xpdra-121.log... Pattern found! simulator for xpdra started 12:16:44 starting simulator roadma in OpenROADM device version 2.2.1... 12:16:44 Searching for pattern 'Netconf SSH endpoint started successfully at 0.0.0.0' in roadma-221.log... Pattern found! simulator for roadma started 12:16:44 starting simulator roadmc in OpenROADM device version 2.2.1... 12:16:44 Searching for pattern 'Netconf SSH endpoint started successfully at 0.0.0.0' in roadmc-221.log... Pattern found! simulator for roadmc started 12:16:44 starting simulator xpdrc in OpenROADM device version 7.1... 12:16:44 Searching for pattern 'Netconf SSH endpoint started successfully at 0.0.0.0' in xpdrc-71.log... Pattern found! simulator for xpdrc started 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_01_connect_xpdrA 12:16:44 ________________ TransportPCEFulltesting.test_02_connect_xpdrC _________________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1' 12:16:44 body = '{"node": [{"node-id": "XPDR-C1", "netconf-node-topology:username": "admin", "netconf-node-topology:password": "admin"...f-node-topology:port": "17854", "netconf-node-topology:tcp-only": "false", "netconf-node-topology:pass-through": {}}]}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '287', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_02_connect_xpdrC(self): 12:16:44 > response = test_utils.mount_device("XPDR-C1", ('xpdrc', self.NODE_VERSION_71)) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:101: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:337: in mount_device 12:16:44 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_02_connect_xpdrC 12:16:44 _________________ TransportPCEFulltesting.test_03_connect_rdmA _________________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1' 12:16:44 body = '{"node": [{"node-id": "ROADM-A1", "netconf-node-topology:username": "admin", "netconf-node-topology:password": "admin...f-node-topology:port": "17841", "netconf-node-topology:tcp-only": "false", "netconf-node-topology:pass-through": {}}]}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '288', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_03_connect_rdmA(self): 12:16:44 > response = test_utils.mount_device("ROADM-A1", ('roadma', self.NODE_VERSION_221)) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:106: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:337: in mount_device 12:16:44 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_03_connect_rdmA 12:16:44 _________________ TransportPCEFulltesting.test_04_connect_rdmC _________________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1' 12:16:44 body = '{"node": [{"node-id": "ROADM-C1", "netconf-node-topology:username": "admin", "netconf-node-topology:password": "admin...f-node-topology:port": "17843", "netconf-node-topology:tcp-only": "false", "netconf-node-topology:pass-through": {}}]}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '288', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_04_connect_rdmC(self): 12:16:44 > response = test_utils.mount_device("ROADM-C1", ('roadmc', self.NODE_VERSION_221)) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:111: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:337: in mount_device 12:16:44 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_04_connect_rdmC 12:16:44 ________ TransportPCEFulltesting.test_05_connect_xpdrA_N1_to_roadmA_PP1 ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 12:16:44 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADM-A1", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-xpdr-rdm-links', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-xpdr-rdm-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_05_connect_xpdrA_N1_to_roadmA_PP1(self): 12:16:44 > response = test_utils.transportpce_api_rpc_request( 12:16:44 'transportpce-networkutils', 'init-xpdr-rdm-links', 12:16:44 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '1', 12:16:44 'rdm-node': 'ROADM-A1', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:116: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:44 response = post_request(url, data) 12:16:44 transportpce_tests/common/test_utils.py:141: in post_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-xpdr-rdm-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_05_connect_xpdrA_N1_to_roadmA_PP1 12:16:44 ________ TransportPCEFulltesting.test_06_connect_roadmA_PP1_to_xpdrA_N1 ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 12:16:44 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADM-A1", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-rdm-xpdr-links', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-rdm-xpdr-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_06_connect_roadmA_PP1_to_xpdrA_N1(self): 12:16:44 > response = test_utils.transportpce_api_rpc_request( 12:16:44 'transportpce-networkutils', 'init-rdm-xpdr-links', 12:16:44 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '1', 12:16:44 'rdm-node': 'ROADM-A1', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:124: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:44 response = post_request(url, data) 12:16:44 transportpce_tests/common/test_utils.py:141: in post_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-rdm-xpdr-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_06_connect_roadmA_PP1_to_xpdrA_N1 12:16:44 ________ TransportPCEFulltesting.test_07_connect_xpdrC_N1_to_roadmC_PP1 ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 12:16:44 body = '{"input": {"links-input": {"xpdr-node": "XPDR-C1", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADM-C1", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-xpdr-rdm-links', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-xpdr-rdm-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_07_connect_xpdrC_N1_to_roadmC_PP1(self): 12:16:44 > response = test_utils.transportpce_api_rpc_request( 12:16:44 'transportpce-networkutils', 'init-xpdr-rdm-links', 12:16:44 {'links-input': {'xpdr-node': 'XPDR-C1', 'xpdr-num': '1', 'network-num': '1', 12:16:44 'rdm-node': 'ROADM-C1', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:132: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:44 response = post_request(url, data) 12:16:44 transportpce_tests/common/test_utils.py:141: in post_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-xpdr-rdm-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_07_connect_xpdrC_N1_to_roadmC_PP1 12:16:44 ________ TransportPCEFulltesting.test_08_connect_roadmC_PP1_to_xpdrC_N1 ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 12:16:44 body = '{"input": {"links-input": {"xpdr-node": "XPDR-C1", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADM-C1", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-rdm-xpdr-links', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'POST' 12:16:44 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-rdm-xpdr-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_08_connect_roadmC_PP1_to_xpdrC_N1(self): 12:16:44 > response = test_utils.transportpce_api_rpc_request( 12:16:44 'transportpce-networkutils', 'init-rdm-xpdr-links', 12:16:44 {'links-input': {'xpdr-node': 'XPDR-C1', 'xpdr-num': '1', 'network-num': '1', 12:16:44 'rdm-node': 'ROADM-C1', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:140: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:44 response = post_request(url, data) 12:16:44 transportpce_tests/common/test_utils.py:141: in post_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-networkutils:init-rdm-xpdr-links (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_08_connect_roadmC_PP1_to_xpdrC_N1 12:16:44 _______ TransportPCEFulltesting.test_09_add_omsAttributes_ROADMA_ROADMC ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span' 12:16:44 body = '{"span": {"auto-spanloss": "true", "spanloss-base": 11.4, "spanloss-current": 12, "engineered-spanloss": 12.2, "link-concatenation": [{"SRLG-Id": 0, "fiber-type": "smf", "SRLG-length": 100000, "pmd": 0.5}]}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '207', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology/i...2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_09_add_omsAttributes_ROADMA_ROADMC(self): 12:16:44 # Config ROADMA-ROADMC oms-attributes 12:16:44 data = {"span": { 12:16:44 "auto-spanloss": "true", 12:16:44 "spanloss-base": 11.4, 12:16:44 "spanloss-current": 12, 12:16:44 "engineered-spanloss": 12.2, 12:16:44 "link-concatenation": [{ 12:16:44 "SRLG-Id": 0, 12:16:44 "fiber-type": "smf", 12:16:44 "SRLG-length": 100000, 12:16:44 "pmd": 0.5}]}} 12:16:44 > response = test_utils.add_oms_attr_request( 12:16:44 "ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX", data) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:159: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:551: in add_oms_attr_request 12:16:44 response = put_request(url2.format('{}', network, link), oms_attr) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_09_add_omsAttributes_ROADMA_ROADMC 12:16:44 _______ TransportPCEFulltesting.test_10_add_omsAttributes_ROADMC_ROADMA ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span' 12:16:44 body = '{"span": {"auto-spanloss": "true", "spanloss-base": 11.4, "spanloss-current": 12, "engineered-spanloss": 12.2, "link-concatenation": [{"SRLG-Id": 0, "fiber-type": "smf", "SRLG-length": 100000, "pmd": 0.5}]}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '207', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology/i...1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'PUT' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_10_add_omsAttributes_ROADMC_ROADMA(self): 12:16:44 # Config ROADMC-ROADMA oms-attributes 12:16:44 data = {"span": { 12:16:44 "auto-spanloss": "true", 12:16:44 "spanloss-base": 11.4, 12:16:44 "spanloss-current": 12, 12:16:44 "engineered-spanloss": 12.2, 12:16:44 "link-concatenation": [{ 12:16:44 "SRLG-Id": 0, 12:16:44 "fiber-type": "smf", 12:16:44 "SRLG-length": 100000, 12:16:44 "pmd": 0.5}]}} 12:16:44 > response = test_utils.add_oms_attr_request( 12:16:44 "ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX", data) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:175: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:551: in add_oms_attr_request 12:16:44 response = put_request(url2.format('{}', network, link), oms_attr) 12:16:44 transportpce_tests/common/test_utils.py:123: in put_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology/ietf-network-topology:link=ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX/org-openroadm-network-topology:OMS-attributes/span (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_10_add_omsAttributes_ROADMC_ROADMA 12:16:44 _____________ TransportPCEFulltesting.test_11_create_eth_service1 ______________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'POST', url = '/rests/operations/org-openroadm-service:service-create' 12:16:44 body = '{"input": {"sdnc-request-header": {"request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58", "rpc-action": "service-creat...-direction": [{"index": 0}], "optic-type": "gray"}, "due-date": "2016-11-28T00:00:01Z", "operator-contact": "pw1234"}}' 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '784', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/org-openroadm-service:service-create', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'POST', url = '/rests/operations/org-openroadm-service:service-create' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/org-openroadm-service:service-create (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_11_create_eth_service1(self): 12:16:44 > response = test_utils.transportpce_api_rpc_request( 12:16:44 'org-openroadm-service', 'service-create', 12:16:44 self.cr_serv_input_data) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:181: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:44 response = post_request(url, data) 12:16:44 transportpce_tests/common/test_utils.py:141: in post_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/org-openroadm-service:service-create (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_11_create_eth_service1 12:16:44 _______________ TransportPCEFulltesting.test_12_get_eth_service1 _______________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_12_get_eth_service1(self): 12:16:44 > response = test_utils.get_ordm_serv_list_attr_request( 12:16:44 "services", "service1") 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:190: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_12_get_eth_service1 12:16:44 ___________ TransportPCEFulltesting.test_14_check_update_portmapping ___________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_14_check_update_portmapping(self): 12:16:44 > response = test_utils.get_portmapping_node_attr("XPDRA01", None, None) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:212: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_14_check_update_portmapping 12:16:44 _________ TransportPCEFulltesting.test_15_check_update_openroadm_topo __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_15_check_update_openroadm_topo(self): 12:16:44 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:229: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_15_check_update_openroadm_topo 12:16:44 ____________ TransportPCEFulltesting.test_16_check_update_service1 _____________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_16_check_update_service1(self): 12:16:44 > response = test_utils.get_ordm_serv_list_attr_request("services", "service1") 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:263: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_16_check_update_service1 12:16:44 _________ TransportPCEFulltesting.test_18_check_update_portmapping_ok __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_18_check_update_portmapping_ok(self): 12:16:44 > response = test_utils.get_portmapping_node_attr("XPDRA01", None, None) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:282: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_18_check_update_portmapping_ok 12:16:44 ________ TransportPCEFulltesting.test_19_check_update_openroadm_topo_ok ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_19_check_update_openroadm_topo_ok(self): 12:16:44 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:293: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_19_check_update_openroadm_topo_ok 12:16:44 ___________ TransportPCEFulltesting.test_20_check_update_service1_ok ___________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_20_check_update_service1_ok(self): 12:16:44 > self.test_12_get_eth_service1() 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:311: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:190: in test_12_get_eth_service1 12:16:44 response = test_utils.get_ordm_serv_list_attr_request( 12:16:44 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_20_check_update_service1_ok 12:16:44 ___________ TransportPCEFulltesting.test_22_check_update_portmapping ___________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_22_check_update_portmapping(self): 12:16:44 > response = test_utils.get_portmapping_node_attr("ROADM-A1", None, None) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:326: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_22_check_update_portmapping 12:16:44 _________ TransportPCEFulltesting.test_23_check_update_openroadm_topo __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_23_check_update_openroadm_topo(self): 12:16:44 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:343: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_23_check_update_openroadm_topo 12:16:44 _________ TransportPCEFulltesting.test_25_check_update_portmapping_ok __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_25_check_update_portmapping_ok(self): 12:16:44 > self.test_18_check_update_portmapping_ok() 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:389: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:282: in test_18_check_update_portmapping_ok 12:16:44 response = test_utils.get_portmapping_node_attr("XPDRA01", None, None) 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_25_check_update_portmapping_ok 12:16:44 ________ TransportPCEFulltesting.test_26_check_update_openroadm_topo_ok ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_26_check_update_openroadm_topo_ok(self): 12:16:44 > self.test_19_check_update_openroadm_topo_ok() 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:392: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:293: in test_19_check_update_openroadm_topo_ok 12:16:44 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:44 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_26_check_update_openroadm_topo_ok 12:16:44 ___________ TransportPCEFulltesting.test_27_check_update_service1_ok ___________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_27_check_update_service1_ok(self): 12:16:44 > self.test_12_get_eth_service1() 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:395: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:190: in test_12_get_eth_service1 12:16:44 response = test_utils.get_ordm_serv_list_attr_request( 12:16:44 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_27_check_update_service1_ok 12:16:44 ___________ TransportPCEFulltesting.test_29_check_update_portmapping ___________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_29_check_update_portmapping(self): 12:16:44 > response = test_utils.get_portmapping_node_attr("ROADM-A1", None, None) 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:410: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_29_check_update_portmapping 12:16:44 _________ TransportPCEFulltesting.test_30_check_update_openroadm_topo __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_30_check_update_openroadm_topo(self): 12:16:44 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:427: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:44 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_30_check_update_openroadm_topo 12:16:44 _________ TransportPCEFulltesting.test_32_check_update_portmapping_ok __________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01', body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01', query=None, fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:44 # leave `release_conn` constant throughout the function. That way, if 12:16:44 # the function recurses, the original value of `release_conn` will be 12:16:44 # passed down into the recursive call, and its value will be respected. 12:16:44 # 12:16:44 # See issue #651 [1] for details. 12:16:44 # 12:16:44 # [1] 12:16:44 release_this_conn = release_conn 12:16:44 12:16:44 http_tunnel_required = connection_requires_http_tunnel( 12:16:44 self.proxy, self.proxy_config, destination_scheme 12:16:44 ) 12:16:44 12:16:44 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:44 # have to copy the headers dict so we can safely change it without those 12:16:44 # changes being reflected in anyone else's copy. 12:16:44 if not http_tunnel_required: 12:16:44 headers = headers.copy() # type: ignore[attr-defined] 12:16:44 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:44 12:16:44 # Must keep the exception bound to a separate variable or else Python 3 12:16:44 # complains about UnboundLocalError. 12:16:44 err = None 12:16:44 12:16:44 # Keep track of whether we cleanly exited the except block. This 12:16:44 # ensures we do proper cleanup in finally. 12:16:44 clean_exit = False 12:16:44 12:16:44 # Rewind body position, if needed. Record current position 12:16:44 # for future rewinds in the event of a redirect/retry. 12:16:44 body_pos = set_file_position(body, body_pos) 12:16:44 12:16:44 try: 12:16:44 # Request a connection from the queue. 12:16:44 timeout_obj = self._get_timeout(timeout) 12:16:44 conn = self._get_conn(timeout=pool_timeout) 12:16:44 12:16:44 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:44 12:16:44 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:44 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:44 try: 12:16:44 self._prepare_proxy(conn) 12:16:44 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:44 self._raise_timeout( 12:16:44 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:44 ) 12:16:44 raise 12:16:44 12:16:44 # If we're going to release the connection in ``finally:``, then 12:16:44 # the response doesn't need to know about the connection. Otherwise 12:16:44 # it will also try to release it and we'll have a double-release 12:16:44 # mess. 12:16:44 response_conn = conn if not release_conn else None 12:16:44 12:16:44 # Make the request on the HTTPConnection object 12:16:44 > response = self._make_request( 12:16:44 conn, 12:16:44 method, 12:16:44 url, 12:16:44 timeout=timeout_obj, 12:16:44 body=body, 12:16:44 headers=headers, 12:16:44 chunked=chunked, 12:16:44 retries=retries, 12:16:44 response_conn=response_conn, 12:16:44 preload_content=preload_content, 12:16:44 decode_content=decode_content, 12:16:44 **response_kw, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:44 conn.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:44 self.endheaders() 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:44 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:44 self.send(msg) 12:16:44 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:44 self.connect() 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:44 self.sock = self._new_conn() 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 except socket.gaierror as e: 12:16:44 raise NameResolutionError(self.host, self, e) from e 12:16:44 except SocketTimeout as e: 12:16:44 raise ConnectTimeoutError( 12:16:44 self, 12:16:44 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:44 ) from e 12:16:44 12:16:44 except OSError as e: 12:16:44 > raise NewConnectionError( 12:16:44 self, f"Failed to establish a new connection: {e}" 12:16:44 ) from e 12:16:44 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 > resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:44 retries = retries.increment( 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01' 12:16:44 response = None 12:16:44 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:44 _pool = 12:16:44 _stacktrace = 12:16:44 12:16:44 def increment( 12:16:44 self, 12:16:44 method: str | None = None, 12:16:44 url: str | None = None, 12:16:44 response: BaseHTTPResponse | None = None, 12:16:44 error: Exception | None = None, 12:16:44 _pool: ConnectionPool | None = None, 12:16:44 _stacktrace: TracebackType | None = None, 12:16:44 ) -> Retry: 12:16:44 """Return a new Retry object with incremented retry counters. 12:16:44 12:16:44 :param response: A response object, or None, if the server did not 12:16:44 return a response. 12:16:44 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:44 :param Exception error: An error encountered during the request, or 12:16:44 None if the response was received successfully. 12:16:44 12:16:44 :return: A new ``Retry`` object. 12:16:44 """ 12:16:44 if self.total is False and error: 12:16:44 # Disabled, indicate to re-raise the error. 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 12:16:44 total = self.total 12:16:44 if total is not None: 12:16:44 total -= 1 12:16:44 12:16:44 connect = self.connect 12:16:44 read = self.read 12:16:44 redirect = self.redirect 12:16:44 status_count = self.status 12:16:44 other = self.other 12:16:44 cause = "unknown" 12:16:44 status = None 12:16:44 redirect_location = None 12:16:44 12:16:44 if error and self._is_connection_error(error): 12:16:44 # Connect retry? 12:16:44 if connect is False: 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif connect is not None: 12:16:44 connect -= 1 12:16:44 12:16:44 elif error and self._is_read_error(error): 12:16:44 # Read retry? 12:16:44 if read is False or method is None or not self._is_method_retryable(method): 12:16:44 raise reraise(type(error), error, _stacktrace) 12:16:44 elif read is not None: 12:16:44 read -= 1 12:16:44 12:16:44 elif error: 12:16:44 # Other retry? 12:16:44 if other is not None: 12:16:44 other -= 1 12:16:44 12:16:44 elif response and response.get_redirect_location(): 12:16:44 # Redirect retry? 12:16:44 if redirect is not None: 12:16:44 redirect -= 1 12:16:44 cause = "too many redirects" 12:16:44 response_redirect_location = response.get_redirect_location() 12:16:44 if response_redirect_location: 12:16:44 redirect_location = response_redirect_location 12:16:44 status = response.status 12:16:44 12:16:44 else: 12:16:44 # Incrementing because of a server error like a 500 in 12:16:44 # status_forcelist and the given method is in the allowed_methods 12:16:44 cause = ResponseError.GENERIC_ERROR 12:16:44 if response and response.status: 12:16:44 if status_count is not None: 12:16:44 status_count -= 1 12:16:44 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:44 status = response.status 12:16:44 12:16:44 history = self.history + ( 12:16:44 RequestHistory(method, url, error, status, redirect_location), 12:16:44 ) 12:16:44 12:16:44 new_retry = self.new( 12:16:44 total=total, 12:16:44 connect=connect, 12:16:44 read=read, 12:16:44 redirect=redirect, 12:16:44 status=status_count, 12:16:44 other=other, 12:16:44 history=history, 12:16:44 ) 12:16:44 12:16:44 if new_retry.is_exhausted(): 12:16:44 reason = error or ResponseError(cause) 12:16:44 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:44 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:44 12:16:44 During handling of the above exception, another exception occurred: 12:16:44 12:16:44 self = 12:16:44 12:16:44 def test_32_check_update_portmapping_ok(self): 12:16:44 > self.test_18_check_update_portmapping_ok() 12:16:44 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:473: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 transportpce_tests/hybrid/test01_device_change_notifications.py:282: in test_18_check_update_portmapping_ok 12:16:44 response = test_utils.get_portmapping_node_attr("XPDRA01", None, None) 12:16:44 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:44 response = get_request(target_url) 12:16:44 transportpce_tests/common/test_utils.py:115: in get_request 12:16:44 return requests.request( 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:44 return session.request(method=method, url=url, **kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:44 resp = self.send(prep, **send_kwargs) 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:44 r = adapter.send(request, **kwargs) 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 self = 12:16:44 request = , stream = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:44 proxies = OrderedDict() 12:16:44 12:16:44 def send( 12:16:44 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:44 ): 12:16:44 """Sends PreparedRequest object. Returns Response object. 12:16:44 12:16:44 :param request: The :class:`PreparedRequest ` being sent. 12:16:44 :param stream: (optional) Whether to stream the request content. 12:16:44 :param timeout: (optional) How long to wait for the server to send 12:16:44 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:44 read timeout) ` tuple. 12:16:44 :type timeout: float or tuple or urllib3 Timeout object 12:16:44 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:44 we verify the server's TLS certificate, or a string, in which case it 12:16:44 must be a path to a CA bundle to use 12:16:44 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:44 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:44 :rtype: requests.Response 12:16:44 """ 12:16:44 12:16:44 try: 12:16:44 conn = self.get_connection(request.url, proxies) 12:16:44 except LocationValueError as e: 12:16:44 raise InvalidURL(e, request=request) 12:16:44 12:16:44 self.cert_verify(conn, request.url, verify, cert) 12:16:44 url = self.request_url(request, proxies) 12:16:44 self.add_headers( 12:16:44 request, 12:16:44 stream=stream, 12:16:44 timeout=timeout, 12:16:44 verify=verify, 12:16:44 cert=cert, 12:16:44 proxies=proxies, 12:16:44 ) 12:16:44 12:16:44 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:44 12:16:44 if isinstance(timeout, tuple): 12:16:44 try: 12:16:44 connect, read = timeout 12:16:44 timeout = TimeoutSauce(connect=connect, read=read) 12:16:44 except ValueError: 12:16:44 raise ValueError( 12:16:44 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:44 f"or a single float to set both timeouts to the same value." 12:16:44 ) 12:16:44 elif isinstance(timeout, TimeoutSauce): 12:16:44 pass 12:16:44 else: 12:16:44 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:44 12:16:44 try: 12:16:44 resp = conn.urlopen( 12:16:44 method=request.method, 12:16:44 url=url, 12:16:44 body=request.body, 12:16:44 headers=request.headers, 12:16:44 redirect=False, 12:16:44 assert_same_host=False, 12:16:44 preload_content=False, 12:16:44 decode_content=False, 12:16:44 retries=self.max_retries, 12:16:44 timeout=timeout, 12:16:44 chunked=chunked, 12:16:44 ) 12:16:44 12:16:44 except (ProtocolError, OSError) as err: 12:16:44 raise ConnectionError(err, request=request) 12:16:44 12:16:44 except MaxRetryError as e: 12:16:44 if isinstance(e.reason, ConnectTimeoutError): 12:16:44 # TODO: Remove this in 3.0.0: see #2811 12:16:44 if not isinstance(e.reason, NewConnectionError): 12:16:44 raise ConnectTimeout(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, ResponseError): 12:16:44 raise RetryError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _ProxyError): 12:16:44 raise ProxyError(e, request=request) 12:16:44 12:16:44 if isinstance(e.reason, _SSLError): 12:16:44 # This branch is for urllib3 v1.22 and later. 12:16:44 raise SSLError(e, request=request) 12:16:44 12:16:44 > raise ConnectionError(e, request=request) 12:16:44 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:44 ----------------------------- Captured stdout call ----------------------------- 12:16:44 execution of test_32_check_update_portmapping_ok 12:16:44 ________ TransportPCEFulltesting.test_33_check_update_openroadm_topo_ok ________ 12:16:44 12:16:44 self = 12:16:44 12:16:44 def _new_conn(self) -> socket.socket: 12:16:44 """Establish a socket connection and set nodelay settings on it. 12:16:44 12:16:44 :return: New socket connection. 12:16:44 """ 12:16:44 try: 12:16:44 > sock = connection.create_connection( 12:16:44 (self._dns_host, self.port), 12:16:44 self.timeout, 12:16:44 source_address=self.source_address, 12:16:44 socket_options=self.socket_options, 12:16:44 ) 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:44 raise err 12:16:44 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:44 12:16:44 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:44 socket_options = [(6, 1, 1)] 12:16:44 12:16:44 def create_connection( 12:16:44 address: tuple[str, int], 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 source_address: tuple[str, int] | None = None, 12:16:44 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:44 ) -> socket.socket: 12:16:44 """Connect to *address* and return the socket object. 12:16:44 12:16:44 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:44 port)``) and return the socket object. Passing the optional 12:16:44 *timeout* parameter will set the timeout on the socket instance 12:16:44 before attempting to connect. If no *timeout* is supplied, the 12:16:44 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:44 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:44 for the socket to bind as a source address before making the connection. 12:16:44 An host of '' or port 0 tells the OS to use the default. 12:16:44 """ 12:16:44 12:16:44 host, port = address 12:16:44 if host.startswith("["): 12:16:44 host = host.strip("[]") 12:16:44 err = None 12:16:44 12:16:44 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:44 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:44 # The original create_connection function always returns all records. 12:16:44 family = allowed_gai_family() 12:16:44 12:16:44 try: 12:16:44 host.encode("idna") 12:16:44 except UnicodeError: 12:16:44 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:44 12:16:44 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:44 af, socktype, proto, canonname, sa = res 12:16:44 sock = None 12:16:44 try: 12:16:44 sock = socket.socket(af, socktype, proto) 12:16:44 12:16:44 # If provided, set socket level options before connecting. 12:16:44 _set_socket_options(sock, socket_options) 12:16:44 12:16:44 if timeout is not _DEFAULT_TIMEOUT: 12:16:44 sock.settimeout(timeout) 12:16:44 if source_address: 12:16:44 sock.bind(source_address) 12:16:44 > sock.connect(sa) 12:16:44 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:44 12:16:44 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:44 12:16:44 The above exception was the direct cause of the following exception: 12:16:44 12:16:44 self = 12:16:44 method = 'GET' 12:16:44 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:44 body = None 12:16:44 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:44 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:44 redirect = False, assert_same_host = False 12:16:44 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:44 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:44 decode_content = False, response_kw = {} 12:16:44 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:44 destination_scheme = None, conn = None, release_this_conn = True 12:16:44 http_tunnel_required = False, err = None, clean_exit = False 12:16:44 12:16:44 def urlopen( # type: ignore[override] 12:16:44 self, 12:16:44 method: str, 12:16:44 url: str, 12:16:44 body: _TYPE_BODY | None = None, 12:16:44 headers: typing.Mapping[str, str] | None = None, 12:16:44 retries: Retry | bool | int | None = None, 12:16:44 redirect: bool = True, 12:16:44 assert_same_host: bool = True, 12:16:44 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:44 pool_timeout: int | None = None, 12:16:44 release_conn: bool | None = None, 12:16:44 chunked: bool = False, 12:16:44 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:44 preload_content: bool = True, 12:16:44 decode_content: bool = True, 12:16:44 **response_kw: typing.Any, 12:16:44 ) -> BaseHTTPResponse: 12:16:44 """ 12:16:44 Get a connection from the pool and perform an HTTP request. This is the 12:16:44 lowest level call for making a request, so you'll need to specify all 12:16:44 the raw details. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 More commonly, it's appropriate to use a convenience method 12:16:44 such as :meth:`request`. 12:16:44 12:16:44 .. note:: 12:16:44 12:16:44 `release_conn` will only behave as expected if 12:16:44 `preload_content=False` because we want to make 12:16:44 `preload_content=False` the default behaviour someday soon without 12:16:44 breaking backwards compatibility. 12:16:44 12:16:44 :param method: 12:16:44 HTTP request method (such as GET, POST, PUT, etc.) 12:16:44 12:16:44 :param url: 12:16:44 The URL to perform the request on. 12:16:44 12:16:44 :param body: 12:16:44 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:44 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:44 12:16:44 :param headers: 12:16:44 Dictionary of custom headers to send, such as User-Agent, 12:16:44 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:44 these headers completely replace any pool-specific headers. 12:16:44 12:16:44 :param retries: 12:16:44 Configure the number of retries to allow before raising a 12:16:44 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:44 12:16:44 Pass ``None`` to retry until you receive a response. Pass a 12:16:44 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:44 over different types of retries. 12:16:44 Pass an integer number to retry connection errors that many times, 12:16:44 but no other types of errors. Pass zero to never retry. 12:16:44 12:16:44 If ``False``, then retries are disabled and any exception is raised 12:16:44 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:44 the redirect response will be returned. 12:16:44 12:16:44 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:44 12:16:44 :param redirect: 12:16:44 If True, automatically handle redirects (status codes 301, 302, 12:16:44 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:44 will disable redirect, too. 12:16:44 12:16:44 :param assert_same_host: 12:16:44 If ``True``, will make sure that the host of the pool requests is 12:16:44 consistent else will raise HostChangedError. When ``False``, you can 12:16:44 use the pool on an HTTP proxy and request foreign hosts. 12:16:44 12:16:44 :param timeout: 12:16:44 If specified, overrides the default timeout for this one 12:16:44 request. It may be a float (in seconds) or an instance of 12:16:44 :class:`urllib3.util.Timeout`. 12:16:44 12:16:44 :param pool_timeout: 12:16:44 If set and the pool is set to block=True, then this method will 12:16:44 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:44 connection is available within the time period. 12:16:44 12:16:44 :param bool preload_content: 12:16:44 If True, the response's body will be preloaded into memory. 12:16:44 12:16:44 :param bool decode_content: 12:16:44 If True, will attempt to decode the body based on the 12:16:44 'content-encoding' header. 12:16:44 12:16:44 :param release_conn: 12:16:44 If False, then the urlopen call will not release the connection 12:16:44 back into the pool once a response is received (but will release if 12:16:44 you read the entire contents of the response such as when 12:16:44 `preload_content=True`). This is useful if you're not preloading 12:16:44 the response's content immediately. You will need to call 12:16:44 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:44 back into the pool. If None, it takes the value of ``preload_content`` 12:16:44 which defaults to ``True``. 12:16:44 12:16:44 :param bool chunked: 12:16:44 If True, urllib3 will send the body using chunked transfer 12:16:44 encoding. Otherwise, urllib3 will send the body using the standard 12:16:44 content-length form. Defaults to False. 12:16:44 12:16:44 :param int body_pos: 12:16:44 Position to seek to in file-like body in the event of a retry or 12:16:44 redirect. Typically this won't need to be set because urllib3 will 12:16:44 auto-populate the value when needed. 12:16:44 """ 12:16:44 parsed_url = parse_url(url) 12:16:44 destination_scheme = parsed_url.scheme 12:16:44 12:16:44 if headers is None: 12:16:44 headers = self.headers 12:16:44 12:16:44 if not isinstance(retries, Retry): 12:16:44 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:44 12:16:44 if release_conn is None: 12:16:44 release_conn = preload_content 12:16:44 12:16:44 # Check host 12:16:44 if assert_same_host and not self.is_same_host(url): 12:16:44 raise HostChangedError(self, url, retries) 12:16:44 12:16:44 # Ensure that the URL we're connecting to is properly encoded 12:16:44 if url.startswith("/"): 12:16:44 url = to_str(_encode_target(url)) 12:16:44 else: 12:16:44 url = to_str(parsed_url.url) 12:16:44 12:16:44 conn = None 12:16:44 12:16:44 # Track whether `conn` needs to be released before 12:16:44 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_33_check_update_openroadm_topo_ok(self): 12:16:45 > self.test_19_check_update_openroadm_topo_ok() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:476: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:293: in test_19_check_update_openroadm_topo_ok 12:16:45 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:45 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_33_check_update_openroadm_topo_ok 12:16:45 ___________ TransportPCEFulltesting.test_34_check_update_service1_ok ___________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_34_check_update_service1_ok(self): 12:16:45 > self.test_12_get_eth_service1() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:479: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:190: in test_12_get_eth_service1 12:16:45 response = test_utils.get_ordm_serv_list_attr_request( 12:16:45 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_34_check_update_service1_ok 12:16:45 ___________ TransportPCEFulltesting.test_36_check_update_portmapping ___________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=XPDR-C1', body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDR-C1', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=XPDR-C1' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_36_check_update_portmapping(self): 12:16:45 > response = test_utils.get_portmapping_node_attr("XPDR-C1", None, None) 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:492: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:45 response = get_request(target_url) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_36_check_update_portmapping 12:16:45 _________ TransportPCEFulltesting.test_37_check_update_openroadm_topo __________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_37_check_update_openroadm_topo(self): 12:16:45 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:509: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_37_check_update_openroadm_topo 12:16:45 _________ TransportPCEFulltesting.test_39_check_update_portmapping_ok __________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01', body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=XPDRA01', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=XPDRA01' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_39_check_update_portmapping_ok(self): 12:16:45 > self.test_18_check_update_portmapping_ok() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:553: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:282: in test_18_check_update_portmapping_ok 12:16:45 response = test_utils.get_portmapping_node_attr("XPDRA01", None, None) 12:16:45 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:45 response = get_request(target_url) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_39_check_update_portmapping_ok 12:16:45 ________ TransportPCEFulltesting.test_40_check_update_openroadm_topo_ok ________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_40_check_update_openroadm_topo_ok(self): 12:16:45 > self.test_19_check_update_openroadm_topo_ok() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:556: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:293: in test_19_check_update_openroadm_topo_ok 12:16:45 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:45 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_40_check_update_openroadm_topo_ok 12:16:45 ___________ TransportPCEFulltesting.test_41_check_update_service1_ok ___________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_41_check_update_service1_ok(self): 12:16:45 > self.test_12_get_eth_service1() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:559: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:190: in test_12_get_eth_service1 12:16:45 response = test_utils.get_ordm_serv_list_attr_request( 12:16:45 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_41_check_update_service1_ok 12:16:45 ___________ TransportPCEFulltesting.test_43_check_update_portmapping ___________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/transportpce-portmapping:network/nodes=ROADM-A1', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/transportpce-portmapping:network/nodes=ROADM-A1' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_43_check_update_portmapping(self): 12:16:45 > response = test_utils.get_portmapping_node_attr("ROADM-A1", None, None) 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:574: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:463: in get_portmapping_node_attr 12:16:45 response = get_request(target_url) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/transportpce-portmapping:network/nodes=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_43_check_update_portmapping 12:16:45 _________ TransportPCEFulltesting.test_44_check_update_openroadm_topo __________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_44_check_update_openroadm_topo(self): 12:16:45 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:591: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_44_check_update_openroadm_topo 12:16:45 ___________ TransportPCEFulltesting.test_45_check_update_service1_ok ___________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/org-openroadm-service:service-list/services=service1', query='content=nonconfig', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_45_check_update_service1_ok(self): 12:16:45 > self.test_12_get_eth_service1() 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:618: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:190: in test_12_get_eth_service1 12:16:45 response = test_utils.get_ordm_serv_list_attr_request( 12:16:45 transportpce_tests/common/test_utils.py:622: in get_ordm_serv_list_attr_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/org-openroadm-service:service-list/services=service1?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_45_check_update_service1_ok 12:16:45 _____________ TransportPCEFulltesting.test_46_delete_eth_service1 ______________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'POST', url = '/rests/operations/org-openroadm-service:service-delete' 12:16:45 body = '{"input": {"sdnc-request-header": {"request-id": "e3028bae-a90f-4ddd-a83f-cf224eba0e58", "rpc-action": "service-delet...st:8585/NotificationServer/notify"}, "service-delete-req-info": {"service-name": "service1", "tail-retention": "no"}}}' 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '306', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/org-openroadm-service:service-delete', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'POST', url = '/rests/operations/org-openroadm-service:service-delete' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/org-openroadm-service:service-delete (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_46_delete_eth_service1(self): 12:16:45 self.del_serv_input_data["service-delete-req-info"]["service-name"] = "service1" 12:16:45 > response = test_utils.transportpce_api_rpc_request( 12:16:45 'org-openroadm-service', 'service-delete', 12:16:45 self.del_serv_input_data) 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:622: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:677: in transportpce_api_rpc_request 12:16:45 response = post_request(url, data) 12:16:45 transportpce_tests/common/test_utils.py:141: in post_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/org-openroadm-service:service-delete (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_46_delete_eth_service1 12:16:45 ________ TransportPCEFulltesting.test_47_disconnect_xponders_from_roadm ________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/ietf-network:networks/network=openroadm-topology', query='content=config', fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'GET' 12:16:45 url = '/rests/data/ietf-network:networks/network=openroadm-topology?content=config' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_47_disconnect_xponders_from_roadm(self): 12:16:45 > response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:631: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:488: in get_ietf_network_request 12:16:45 response = get_request(url[RESTCONF_VERSION].format(*format_args)) 12:16:45 transportpce_tests/common/test_utils.py:115: in get_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/ietf-network:networks/network=openroadm-topology?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_47_disconnect_xponders_from_roadm 12:16:45 _______________ TransportPCEFulltesting.test_48_disconnect_XPDRA _______________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 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) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_48_disconnect_XPDRA(self): 12:16:45 > response = test_utils.unmount_device("XPDRA01") 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:641: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:351: in unmount_device 12:16:45 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 12:16:45 transportpce_tests/common/test_utils.py:132: in delete_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_48_disconnect_XPDRA 12:16:45 _______________ TransportPCEFulltesting.test_49_disconnect_XPDRC _______________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_49_disconnect_XPDRC(self): 12:16:45 > response = test_utils.unmount_device("XPDR-C1") 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:645: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:351: in unmount_device 12:16:45 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 12:16:45 transportpce_tests/common/test_utils.py:132: in delete_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDR-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_49_disconnect_XPDRC 12:16:45 ______________ TransportPCEFulltesting.test_50_disconnect_ROADMA _______________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_50_disconnect_ROADMA(self): 12:16:45 > response = test_utils.unmount_device("ROADM-A1") 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:649: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:351: in unmount_device 12:16:45 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 12:16:45 transportpce_tests/common/test_utils.py:132: in delete_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-A1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_50_disconnect_ROADMA 12:16:45 ______________ TransportPCEFulltesting.test_51_disconnect_ROADMC _______________ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 > sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:203: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection 12:16:45 raise err 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 address = ('localhost', 8182), timeout = 10, source_address = None 12:16:45 socket_options = [(6, 1, 1)] 12:16:45 12:16:45 def create_connection( 12:16:45 address: tuple[str, int], 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 source_address: tuple[str, int] | None = None, 12:16:45 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 12:16:45 ) -> socket.socket: 12:16:45 """Connect to *address* and return the socket object. 12:16:45 12:16:45 Convenience function. Connect to *address* (a 2-tuple ``(host, 12:16:45 port)``) and return the socket object. Passing the optional 12:16:45 *timeout* parameter will set the timeout on the socket instance 12:16:45 before attempting to connect. If no *timeout* is supplied, the 12:16:45 global default timeout setting returned by :func:`socket.getdefaulttimeout` 12:16:45 is used. If *source_address* is set it must be a tuple of (host, port) 12:16:45 for the socket to bind as a source address before making the connection. 12:16:45 An host of '' or port 0 tells the OS to use the default. 12:16:45 """ 12:16:45 12:16:45 host, port = address 12:16:45 if host.startswith("["): 12:16:45 host = host.strip("[]") 12:16:45 err = None 12:16:45 12:16:45 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 12:16:45 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 12:16:45 # The original create_connection function always returns all records. 12:16:45 family = allowed_gai_family() 12:16:45 12:16:45 try: 12:16:45 host.encode("idna") 12:16:45 except UnicodeError: 12:16:45 raise LocationParseError(f"'{host}', label empty or too long") from None 12:16:45 12:16:45 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 12:16:45 af, socktype, proto, canonname, sa = res 12:16:45 sock = None 12:16:45 try: 12:16:45 sock = socket.socket(af, socktype, proto) 12:16:45 12:16:45 # If provided, set socket level options before connecting. 12:16:45 _set_socket_options(sock, socket_options) 12:16:45 12:16:45 if timeout is not _DEFAULT_TIMEOUT: 12:16:45 sock.settimeout(timeout) 12:16:45 if source_address: 12:16:45 sock.bind(source_address) 12:16:45 > sock.connect(sa) 12:16:45 E ConnectionRefusedError: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1' 12:16:45 body = None 12:16:45 headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 12:16:45 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 redirect = False, assert_same_host = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 12:16:45 release_conn = False, chunked = False, body_pos = None, preload_content = False 12:16:45 decode_content = False, response_kw = {} 12:16:45 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1', query=None, fragment=None) 12:16:45 destination_scheme = None, conn = None, release_this_conn = True 12:16:45 http_tunnel_required = False, err = None, clean_exit = False 12:16:45 12:16:45 def urlopen( # type: ignore[override] 12:16:45 self, 12:16:45 method: str, 12:16:45 url: str, 12:16:45 body: _TYPE_BODY | None = None, 12:16:45 headers: typing.Mapping[str, str] | None = None, 12:16:45 retries: Retry | bool | int | None = None, 12:16:45 redirect: bool = True, 12:16:45 assert_same_host: bool = True, 12:16:45 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 12:16:45 pool_timeout: int | None = None, 12:16:45 release_conn: bool | None = None, 12:16:45 chunked: bool = False, 12:16:45 body_pos: _TYPE_BODY_POSITION | None = None, 12:16:45 preload_content: bool = True, 12:16:45 decode_content: bool = True, 12:16:45 **response_kw: typing.Any, 12:16:45 ) -> BaseHTTPResponse: 12:16:45 """ 12:16:45 Get a connection from the pool and perform an HTTP request. This is the 12:16:45 lowest level call for making a request, so you'll need to specify all 12:16:45 the raw details. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 More commonly, it's appropriate to use a convenience method 12:16:45 such as :meth:`request`. 12:16:45 12:16:45 .. note:: 12:16:45 12:16:45 `release_conn` will only behave as expected if 12:16:45 `preload_content=False` because we want to make 12:16:45 `preload_content=False` the default behaviour someday soon without 12:16:45 breaking backwards compatibility. 12:16:45 12:16:45 :param method: 12:16:45 HTTP request method (such as GET, POST, PUT, etc.) 12:16:45 12:16:45 :param url: 12:16:45 The URL to perform the request on. 12:16:45 12:16:45 :param body: 12:16:45 Data to send in the request body, either :class:`str`, :class:`bytes`, 12:16:45 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 12:16:45 12:16:45 :param headers: 12:16:45 Dictionary of custom headers to send, such as User-Agent, 12:16:45 If-None-Match, etc. If None, pool headers are used. If provided, 12:16:45 these headers completely replace any pool-specific headers. 12:16:45 12:16:45 :param retries: 12:16:45 Configure the number of retries to allow before raising a 12:16:45 :class:`~urllib3.exceptions.MaxRetryError` exception. 12:16:45 12:16:45 Pass ``None`` to retry until you receive a response. Pass a 12:16:45 :class:`~urllib3.util.retry.Retry` object for fine-grained control 12:16:45 over different types of retries. 12:16:45 Pass an integer number to retry connection errors that many times, 12:16:45 but no other types of errors. Pass zero to never retry. 12:16:45 12:16:45 If ``False``, then retries are disabled and any exception is raised 12:16:45 immediately. Also, instead of raising a MaxRetryError on redirects, 12:16:45 the redirect response will be returned. 12:16:45 12:16:45 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 12:16:45 12:16:45 :param redirect: 12:16:45 If True, automatically handle redirects (status codes 301, 302, 12:16:45 303, 307, 308). Each redirect counts as a retry. Disabling retries 12:16:45 will disable redirect, too. 12:16:45 12:16:45 :param assert_same_host: 12:16:45 If ``True``, will make sure that the host of the pool requests is 12:16:45 consistent else will raise HostChangedError. When ``False``, you can 12:16:45 use the pool on an HTTP proxy and request foreign hosts. 12:16:45 12:16:45 :param timeout: 12:16:45 If specified, overrides the default timeout for this one 12:16:45 request. It may be a float (in seconds) or an instance of 12:16:45 :class:`urllib3.util.Timeout`. 12:16:45 12:16:45 :param pool_timeout: 12:16:45 If set and the pool is set to block=True, then this method will 12:16:45 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 12:16:45 connection is available within the time period. 12:16:45 12:16:45 :param bool preload_content: 12:16:45 If True, the response's body will be preloaded into memory. 12:16:45 12:16:45 :param bool decode_content: 12:16:45 If True, will attempt to decode the body based on the 12:16:45 'content-encoding' header. 12:16:45 12:16:45 :param release_conn: 12:16:45 If False, then the urlopen call will not release the connection 12:16:45 back into the pool once a response is received (but will release if 12:16:45 you read the entire contents of the response such as when 12:16:45 `preload_content=True`). This is useful if you're not preloading 12:16:45 the response's content immediately. You will need to call 12:16:45 ``r.release_conn()`` on the response ``r`` to return the connection 12:16:45 back into the pool. If None, it takes the value of ``preload_content`` 12:16:45 which defaults to ``True``. 12:16:45 12:16:45 :param bool chunked: 12:16:45 If True, urllib3 will send the body using chunked transfer 12:16:45 encoding. Otherwise, urllib3 will send the body using the standard 12:16:45 content-length form. Defaults to False. 12:16:45 12:16:45 :param int body_pos: 12:16:45 Position to seek to in file-like body in the event of a retry or 12:16:45 redirect. Typically this won't need to be set because urllib3 will 12:16:45 auto-populate the value when needed. 12:16:45 """ 12:16:45 parsed_url = parse_url(url) 12:16:45 destination_scheme = parsed_url.scheme 12:16:45 12:16:45 if headers is None: 12:16:45 headers = self.headers 12:16:45 12:16:45 if not isinstance(retries, Retry): 12:16:45 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 12:16:45 12:16:45 if release_conn is None: 12:16:45 release_conn = preload_content 12:16:45 12:16:45 # Check host 12:16:45 if assert_same_host and not self.is_same_host(url): 12:16:45 raise HostChangedError(self, url, retries) 12:16:45 12:16:45 # Ensure that the URL we're connecting to is properly encoded 12:16:45 if url.startswith("/"): 12:16:45 url = to_str(_encode_target(url)) 12:16:45 else: 12:16:45 url = to_str(parsed_url.url) 12:16:45 12:16:45 conn = None 12:16:45 12:16:45 # Track whether `conn` needs to be released before 12:16:45 # returning/raising/recursing. Update this variable if necessary, and 12:16:45 # leave `release_conn` constant throughout the function. That way, if 12:16:45 # the function recurses, the original value of `release_conn` will be 12:16:45 # passed down into the recursive call, and its value will be respected. 12:16:45 # 12:16:45 # See issue #651 [1] for details. 12:16:45 # 12:16:45 # [1] 12:16:45 release_this_conn = release_conn 12:16:45 12:16:45 http_tunnel_required = connection_requires_http_tunnel( 12:16:45 self.proxy, self.proxy_config, destination_scheme 12:16:45 ) 12:16:45 12:16:45 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 12:16:45 # have to copy the headers dict so we can safely change it without those 12:16:45 # changes being reflected in anyone else's copy. 12:16:45 if not http_tunnel_required: 12:16:45 headers = headers.copy() # type: ignore[attr-defined] 12:16:45 headers.update(self.proxy_headers) # type: ignore[union-attr] 12:16:45 12:16:45 # Must keep the exception bound to a separate variable or else Python 3 12:16:45 # complains about UnboundLocalError. 12:16:45 err = None 12:16:45 12:16:45 # Keep track of whether we cleanly exited the except block. This 12:16:45 # ensures we do proper cleanup in finally. 12:16:45 clean_exit = False 12:16:45 12:16:45 # Rewind body position, if needed. Record current position 12:16:45 # for future rewinds in the event of a redirect/retry. 12:16:45 body_pos = set_file_position(body, body_pos) 12:16:45 12:16:45 try: 12:16:45 # Request a connection from the queue. 12:16:45 timeout_obj = self._get_timeout(timeout) 12:16:45 conn = self._get_conn(timeout=pool_timeout) 12:16:45 12:16:45 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 12:16:45 12:16:45 # Is this a closed/new connection that requires CONNECT tunnelling? 12:16:45 if self.proxy is not None and http_tunnel_required and conn.is_closed: 12:16:45 try: 12:16:45 self._prepare_proxy(conn) 12:16:45 except (BaseSSLError, OSError, SocketTimeout) as e: 12:16:45 self._raise_timeout( 12:16:45 err=e, url=self.proxy.url, timeout_value=conn.timeout 12:16:45 ) 12:16:45 raise 12:16:45 12:16:45 # If we're going to release the connection in ``finally:``, then 12:16:45 # the response doesn't need to know about the connection. Otherwise 12:16:45 # it will also try to release it and we'll have a double-release 12:16:45 # mess. 12:16:45 response_conn = conn if not release_conn else None 12:16:45 12:16:45 # Make the request on the HTTPConnection object 12:16:45 > response = self._make_request( 12:16:45 conn, 12:16:45 method, 12:16:45 url, 12:16:45 timeout=timeout_obj, 12:16:45 body=body, 12:16:45 headers=headers, 12:16:45 chunked=chunked, 12:16:45 retries=retries, 12:16:45 response_conn=response_conn, 12:16:45 preload_content=preload_content, 12:16:45 decode_content=decode_content, 12:16:45 **response_kw, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:790: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request 12:16:45 conn.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:395: in request 12:16:45 self.endheaders() 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders 12:16:45 self._send_output(message_body, encode_chunked=encode_chunked) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output 12:16:45 self.send(msg) 12:16:45 /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send 12:16:45 self.connect() 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:243: in connect 12:16:45 self.sock = self._new_conn() 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 12:16:45 def _new_conn(self) -> socket.socket: 12:16:45 """Establish a socket connection and set nodelay settings on it. 12:16:45 12:16:45 :return: New socket connection. 12:16:45 """ 12:16:45 try: 12:16:45 sock = connection.create_connection( 12:16:45 (self._dns_host, self.port), 12:16:45 self.timeout, 12:16:45 source_address=self.source_address, 12:16:45 socket_options=self.socket_options, 12:16:45 ) 12:16:45 except socket.gaierror as e: 12:16:45 raise NameResolutionError(self.host, self, e) from e 12:16:45 except SocketTimeout as e: 12:16:45 raise ConnectTimeoutError( 12:16:45 self, 12:16:45 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 12:16:45 ) from e 12:16:45 12:16:45 except OSError as e: 12:16:45 > raise NewConnectionError( 12:16:45 self, f"Failed to establish a new connection: {e}" 12:16:45 ) from e 12:16:45 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError 12:16:45 12:16:45 The above exception was the direct cause of the following exception: 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 > resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:486: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen 12:16:45 retries = retries.increment( 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 12:16:45 method = 'DELETE' 12:16:45 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1' 12:16:45 response = None 12:16:45 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 12:16:45 _pool = 12:16:45 _stacktrace = 12:16:45 12:16:45 def increment( 12:16:45 self, 12:16:45 method: str | None = None, 12:16:45 url: str | None = None, 12:16:45 response: BaseHTTPResponse | None = None, 12:16:45 error: Exception | None = None, 12:16:45 _pool: ConnectionPool | None = None, 12:16:45 _stacktrace: TracebackType | None = None, 12:16:45 ) -> Retry: 12:16:45 """Return a new Retry object with incremented retry counters. 12:16:45 12:16:45 :param response: A response object, or None, if the server did not 12:16:45 return a response. 12:16:45 :type response: :class:`~urllib3.response.BaseHTTPResponse` 12:16:45 :param Exception error: An error encountered during the request, or 12:16:45 None if the response was received successfully. 12:16:45 12:16:45 :return: A new ``Retry`` object. 12:16:45 """ 12:16:45 if self.total is False and error: 12:16:45 # Disabled, indicate to re-raise the error. 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 12:16:45 total = self.total 12:16:45 if total is not None: 12:16:45 total -= 1 12:16:45 12:16:45 connect = self.connect 12:16:45 read = self.read 12:16:45 redirect = self.redirect 12:16:45 status_count = self.status 12:16:45 other = self.other 12:16:45 cause = "unknown" 12:16:45 status = None 12:16:45 redirect_location = None 12:16:45 12:16:45 if error and self._is_connection_error(error): 12:16:45 # Connect retry? 12:16:45 if connect is False: 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif connect is not None: 12:16:45 connect -= 1 12:16:45 12:16:45 elif error and self._is_read_error(error): 12:16:45 # Read retry? 12:16:45 if read is False or method is None or not self._is_method_retryable(method): 12:16:45 raise reraise(type(error), error, _stacktrace) 12:16:45 elif read is not None: 12:16:45 read -= 1 12:16:45 12:16:45 elif error: 12:16:45 # Other retry? 12:16:45 if other is not None: 12:16:45 other -= 1 12:16:45 12:16:45 elif response and response.get_redirect_location(): 12:16:45 # Redirect retry? 12:16:45 if redirect is not None: 12:16:45 redirect -= 1 12:16:45 cause = "too many redirects" 12:16:45 response_redirect_location = response.get_redirect_location() 12:16:45 if response_redirect_location: 12:16:45 redirect_location = response_redirect_location 12:16:45 status = response.status 12:16:45 12:16:45 else: 12:16:45 # Incrementing because of a server error like a 500 in 12:16:45 # status_forcelist and the given method is in the allowed_methods 12:16:45 cause = ResponseError.GENERIC_ERROR 12:16:45 if response and response.status: 12:16:45 if status_count is not None: 12:16:45 status_count -= 1 12:16:45 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 12:16:45 status = response.status 12:16:45 12:16:45 history = self.history + ( 12:16:45 RequestHistory(method, url, error, status, redirect_location), 12:16:45 ) 12:16:45 12:16:45 new_retry = self.new( 12:16:45 total=total, 12:16:45 connect=connect, 12:16:45 read=read, 12:16:45 redirect=redirect, 12:16:45 status=status_count, 12:16:45 other=other, 12:16:45 history=history, 12:16:45 ) 12:16:45 12:16:45 if new_retry.is_exhausted(): 12:16:45 reason = error or ResponseError(cause) 12:16:45 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 12:16:45 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError 12:16:45 12:16:45 During handling of the above exception, another exception occurred: 12:16:45 12:16:45 self = 12:16:45 12:16:45 def test_51_disconnect_ROADMC(self): 12:16:45 > response = test_utils.unmount_device("ROADM-C1") 12:16:45 12:16:45 transportpce_tests/hybrid/test01_device_change_notifications.py:653: 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 transportpce_tests/common/test_utils.py:351: in unmount_device 12:16:45 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 12:16:45 transportpce_tests/common/test_utils.py:132: in delete_request 12:16:45 return requests.request( 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/api.py:59: in request 12:16:45 return session.request(method=method, url=url, **kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:589: in request 12:16:45 resp = self.send(prep, **send_kwargs) 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/sessions.py:703: in send 12:16:45 r = adapter.send(request, **kwargs) 12:16:45 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 12:16:45 12:16:45 self = 12:16:45 request = , stream = False 12:16:45 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 12:16:45 proxies = OrderedDict() 12:16:45 12:16:45 def send( 12:16:45 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 12:16:45 ): 12:16:45 """Sends PreparedRequest object. Returns Response object. 12:16:45 12:16:45 :param request: The :class:`PreparedRequest ` being sent. 12:16:45 :param stream: (optional) Whether to stream the request content. 12:16:45 :param timeout: (optional) How long to wait for the server to send 12:16:45 data before giving up, as a float, or a :ref:`(connect timeout, 12:16:45 read timeout) ` tuple. 12:16:45 :type timeout: float or tuple or urllib3 Timeout object 12:16:45 :param verify: (optional) Either a boolean, in which case it controls whether 12:16:45 we verify the server's TLS certificate, or a string, in which case it 12:16:45 must be a path to a CA bundle to use 12:16:45 :param cert: (optional) Any user-provided SSL certificate to be trusted. 12:16:45 :param proxies: (optional) The proxies dictionary to apply to the request. 12:16:45 :rtype: requests.Response 12:16:45 """ 12:16:45 12:16:45 try: 12:16:45 conn = self.get_connection(request.url, proxies) 12:16:45 except LocationValueError as e: 12:16:45 raise InvalidURL(e, request=request) 12:16:45 12:16:45 self.cert_verify(conn, request.url, verify, cert) 12:16:45 url = self.request_url(request, proxies) 12:16:45 self.add_headers( 12:16:45 request, 12:16:45 stream=stream, 12:16:45 timeout=timeout, 12:16:45 verify=verify, 12:16:45 cert=cert, 12:16:45 proxies=proxies, 12:16:45 ) 12:16:45 12:16:45 chunked = not (request.body is None or "Content-Length" in request.headers) 12:16:45 12:16:45 if isinstance(timeout, tuple): 12:16:45 try: 12:16:45 connect, read = timeout 12:16:45 timeout = TimeoutSauce(connect=connect, read=read) 12:16:45 except ValueError: 12:16:45 raise ValueError( 12:16:45 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 12:16:45 f"or a single float to set both timeouts to the same value." 12:16:45 ) 12:16:45 elif isinstance(timeout, TimeoutSauce): 12:16:45 pass 12:16:45 else: 12:16:45 timeout = TimeoutSauce(connect=timeout, read=timeout) 12:16:45 12:16:45 try: 12:16:45 resp = conn.urlopen( 12:16:45 method=request.method, 12:16:45 url=url, 12:16:45 body=request.body, 12:16:45 headers=request.headers, 12:16:45 redirect=False, 12:16:45 assert_same_host=False, 12:16:45 preload_content=False, 12:16:45 decode_content=False, 12:16:45 retries=self.max_retries, 12:16:45 timeout=timeout, 12:16:45 chunked=chunked, 12:16:45 ) 12:16:45 12:16:45 except (ProtocolError, OSError) as err: 12:16:45 raise ConnectionError(err, request=request) 12:16:45 12:16:45 except MaxRetryError as e: 12:16:45 if isinstance(e.reason, ConnectTimeoutError): 12:16:45 # TODO: Remove this in 3.0.0: see #2811 12:16:45 if not isinstance(e.reason, NewConnectionError): 12:16:45 raise ConnectTimeout(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, ResponseError): 12:16:45 raise RetryError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _ProxyError): 12:16:45 raise ProxyError(e, request=request) 12:16:45 12:16:45 if isinstance(e.reason, _SSLError): 12:16:45 # This branch is for urllib3 v1.22 and later. 12:16:45 raise SSLError(e, request=request) 12:16:45 12:16:45 > raise ConnectionError(e, request=request) 12:16:45 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADM-C1 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 12:16:45 12:16:45 ../.tox/tests_hybrid/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError 12:16:45 ----------------------------- Captured stdout call ----------------------------- 12:16:45 execution of test_51_disconnect_ROADMC 12:16:45 --------------------------- Captured stdout teardown --------------------------- 12:16:45 all processes killed 12:16:45 =========================== short test summary info ============================ 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_01_connect_xpdrA 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_02_connect_xpdrC 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_03_connect_rdmA 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_04_connect_rdmC 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_05_connect_xpdrA_N1_to_roadmA_PP1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_06_connect_roadmA_PP1_to_xpdrA_N1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_07_connect_xpdrC_N1_to_roadmC_PP1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_08_connect_roadmC_PP1_to_xpdrC_N1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_09_add_omsAttributes_ROADMA_ROADMC 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_10_add_omsAttributes_ROADMC_ROADMA 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_11_create_eth_service1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_12_get_eth_service1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_14_check_update_portmapping 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_15_check_update_openroadm_topo 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_16_check_update_service1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_18_check_update_portmapping_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_19_check_update_openroadm_topo_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_20_check_update_service1_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_22_check_update_portmapping 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_23_check_update_openroadm_topo 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_25_check_update_portmapping_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_26_check_update_openroadm_topo_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_27_check_update_service1_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_29_check_update_portmapping 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_30_check_update_openroadm_topo 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_32_check_update_portmapping_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_33_check_update_openroadm_topo_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_34_check_update_service1_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_36_check_update_portmapping 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_37_check_update_openroadm_topo 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_39_check_update_portmapping_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_40_check_update_openroadm_topo_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_41_check_update_service1_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_43_check_update_portmapping 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_44_check_update_openroadm_topo 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_45_check_update_service1_ok 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_46_delete_eth_service1 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_47_disconnect_xponders_from_roadm 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_48_disconnect_XPDRA 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_49_disconnect_XPDRC 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_50_disconnect_ROADMA 12:16:45 FAILED transportpce_tests/hybrid/test01_device_change_notifications.py::TransportPCEFulltesting::test_51_disconnect_ROADMC 12:16:45 42 failed, 9 passed in 104.51s (0:01:44) 12:16:45 tests_hybrid: exit 1 (104.77 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid pid=81067 12:16:45 tests_hybrid: FAIL ✖ in 1 minute 54.84 seconds 12:16:45 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 12:16:52 buildlighty: freeze> python -m pip freeze --all 12:16:52 buildlighty: bcrypt==4.1.2,certifi==2023.11.17,cffi==1.16.0,charset-normalizer==3.3.2,cryptography==41.0.7,dict2xml==1.7.4,exceptiongroup==1.2.0,idna==3.6,iniconfig==2.0.0,lxml==4.9.4,netconf-client==2.5.0,packaging==23.2,paramiko==3.4.0,pip==23.3.2,pluggy==1.3.0,psutil==5.9.7,pycparser==2.21,PyNaCl==1.5.0,pytest==7.4.4,requests==2.31.0,setuptools==69.0.3,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 12:16:52 buildlighty: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh 12:16:52 NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED 12:17:26 buildcontroller: OK (193.28=setup[9.81]+cmd[183.47] seconds) 12:17:26 testsPCE: OK (347.34=setup[92.09]+cmd[255.25] seconds) 12:17:26 sims121: OK (12.82=setup[9.49]+cmd[3.33] seconds) 12:17:26 build_karaf_tests121: OK (49.63=setup[9.43]+cmd[40.21] seconds) 12:17:26 tests121: OK (2208.52=setup[7.33]+cmd[2201.19] seconds) 12:17:26 sims221: OK (13.43=setup[9.18]+cmd[4.25] seconds) 12:17:26 build_karaf_tests221: OK (76.03=setup[14.37]+cmd[61.66] seconds) 12:17:26 tests_tapi: OK (828.03=setup[11.50]+cmd[816.53] seconds) 12:17:26 tests221: OK (2914.69=setup[6.96]+cmd[2907.72] seconds) 12:17:26 sims71: OK (16.90=setup[13.51]+cmd[3.39] seconds) 12:17:26 build_karaf_tests71: OK (66.69=setup[22.26]+cmd[44.43] seconds) 12:17:26 tests71: OK (486.17=setup[7.54]+cmd[1.18,477.45] seconds) 12:17:26 build_karaf_tests_hybrid: OK (72.40=setup[10.45]+cmd[61.95] seconds) 12:17:26 tests_hybrid: FAIL code 1 (114.84=setup[6.98]+cmd[3.09,104.77] seconds) 12:17:26 buildlighty: OK (41.20=setup[7.46]+cmd[33.75] seconds) 12:17:26 docs: OK (64.66=setup[62.72]+cmd[1.94] seconds) 12:17:26 docs-linkcheck: OK (65.75=setup[62.71]+cmd[3.04] seconds) 12:17:26 checkbashisms: OK (79.06=setup[2.93]+cmd[75.31,0.81] seconds) 12:17:26 pre-commit: OK (36.96=setup[3.88]+cmd[25.28,7.80] seconds) 12:17:26 pylint: FAIL code 1 (28.97=setup[4.40]+cmd[24.57] seconds) 12:17:26 evaluation failed :( (4667.26 seconds) 12:17:26 + tox_status=255 12:17:26 + echo '---> Completed tox runs' 12:17:26 ---> Completed tox runs 12:17:26 + for i in .tox/*/log 12:17:26 ++ echo .tox/buildcontroller/log 12:17:26 ++ awk -F/ '{print $2}' 12:17:26 + tox_env=buildcontroller 12:17:26 + cp -r .tox/buildcontroller/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildcontroller 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/build_karaf_tests121/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=build_karaf_tests121 12:17:27 + cp -r .tox/build_karaf_tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests121 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/build_karaf_tests221/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=build_karaf_tests221 12:17:27 + cp -r .tox/build_karaf_tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests221 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/build_karaf_tests71/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=build_karaf_tests71 12:17:27 + cp -r .tox/build_karaf_tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests71 12:17:27 + for i in .tox/*/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 ++ echo .tox/build_karaf_tests_hybrid/log 12:17:27 + tox_env=build_karaf_tests_hybrid 12:17:27 + cp -r .tox/build_karaf_tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests_hybrid 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/buildlighty/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=buildlighty 12:17:27 + cp -r .tox/buildlighty/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildlighty 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/checkbashisms/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=checkbashisms 12:17:27 + cp -r .tox/checkbashisms/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/checkbashisms 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/docs-linkcheck/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=docs-linkcheck 12:17:27 + cp -r .tox/docs-linkcheck/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs-linkcheck 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/docs/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=docs 12:17:27 + cp -r .tox/docs/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/pre-commit/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=pre-commit 12:17:27 + cp -r .tox/pre-commit/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pre-commit 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/pylint/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=pylint 12:17:27 + cp -r .tox/pylint/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pylint 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/sims121/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=sims121 12:17:27 + cp -r .tox/sims121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims121 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/sims221/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=sims221 12:17:27 + cp -r .tox/sims221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims221 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/sims71/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=sims71 12:17:27 + cp -r .tox/sims71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims71 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/tests121/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=tests121 12:17:27 + cp -r .tox/tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests121 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/tests221/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=tests221 12:17:27 + cp -r .tox/tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests221 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/tests71/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=tests71 12:17:27 + cp -r .tox/tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests71 12:17:27 + for i in .tox/*/log 12:17:27 ++ echo .tox/tests_hybrid/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 + tox_env=tests_hybrid 12:17:27 + cp -r .tox/tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_hybrid 12:17:27 + for i in .tox/*/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 ++ echo .tox/testsPCE/log 12:17:27 + tox_env=testsPCE 12:17:27 + cp -r .tox/testsPCE/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/testsPCE 12:17:27 + for i in .tox/*/log 12:17:27 ++ awk -F/ '{print $2}' 12:17:27 ++ echo .tox/tests_tapi/log 12:17:27 + tox_env=tests_tapi 12:17:27 + cp -r .tox/tests_tapi/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_tapi 12:17:27 + DOC_DIR=docs/_build/html 12:17:27 + [[ -d docs/_build/html ]] 12:17:27 + echo '---> Archiving generated docs' 12:17:27 ---> Archiving generated docs 12:17:27 + mv docs/_build/html /w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 12:17:27 + echo '---> tox-run.sh ends' 12:17:27 ---> tox-run.sh ends 12:17:27 + test 255 -eq 0 12:17:27 + exit 255 12:17:28 Build step 'Execute shell' marked build as failure 12:17:28 $ ssh-agent -k 12:17:28 unset SSH_AUTH_SOCK; 12:17:28 unset SSH_AGENT_PID; 12:17:28 echo Agent pid 5562 killed; 12:17:28 [ssh-agent] Stopped. 12:17:28 [PostBuildScript] - [INFO] Executing post build scripts. 12:17:28 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins9219596091628880257.sh 12:17:28 ---> sysstat.sh 12:17:29 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins3980668427252391186.sh 12:17:29 ---> package-listing.sh 12:17:29 ++ facter osfamily 12:17:29 ++ tr '[:upper:]' '[:lower:]' 12:17:29 + OS_FAMILY=redhat 12:17:29 + workspace=/w/workspace/transportpce-tox-verify-transportpce-master 12:17:29 + START_PACKAGES=/tmp/packages_start.txt 12:17:29 + END_PACKAGES=/tmp/packages_end.txt 12:17:29 + DIFF_PACKAGES=/tmp/packages_diff.txt 12:17:29 + PACKAGES=/tmp/packages_start.txt 12:17:29 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 12:17:29 + PACKAGES=/tmp/packages_end.txt 12:17:29 + case "${OS_FAMILY}" in 12:17:29 + rpm -qa 12:17:29 + sort 12:17:30 + '[' -f /tmp/packages_start.txt ']' 12:17:30 + '[' -f /tmp/packages_end.txt ']' 12:17:30 + diff /tmp/packages_start.txt /tmp/packages_end.txt 12:17:30 + true 12:17:30 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 12:17:30 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 12:17:30 + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 12:17:30 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins16996265527611418259.sh 12:17:30 ---> capture-instance-metadata.sh 12:17:30 Setup pyenv: 12:17:30 system 12:17:30 3.8.13 12:17:30 3.9.13 12:17:30 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 12:17:30 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oeL0 from file:/tmp/.os_lf_venv 12:17:32 lf-activate-venv(): INFO: Installing: lftools 12:17:49 lf-activate-venv(): INFO: Adding /tmp/venv-oeL0/bin to PATH 12:17:49 INFO: Running in OpenStack, capturing instance metadata 12:17:49 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins2244802017862246148.sh 12:17:49 provisioning config files... 12:17:50 Could not find credentials [logs] for transportpce-tox-verify-transportpce-master #1265 12:17:50 copy managed file [jenkins-log-archives-settings] to file:/w/workspace/transportpce-tox-verify-transportpce-master@tmp/config15174803826396102072tmp 12:17:50 Regular expression run condition: Expression=[^.*logs-s3.*], Label=[odl-logs-s3-cloudfront-index] 12:17:50 Run condition [Regular expression match] enabling perform for step [Provide Configuration files] 12:17:50 provisioning config files... 12:17:51 copy managed file [jenkins-s3-log-ship] to file:/home/jenkins/.aws/credentials 12:17:51 [EnvInject] - Injecting environment variables from a build step. 12:17:51 [EnvInject] - Injecting as environment variables the properties content 12:17:51 SERVER_ID=logs 12:17:51 12:17:51 [EnvInject] - Variables injected successfully. 12:17:51 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins12217149887293349073.sh 12:17:51 ---> create-netrc.sh 12:17:51 WARN: Log server credential not found. 12:17:51 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins16041041737310237523.sh 12:17:51 ---> python-tools-install.sh 12:17:51 Setup pyenv: 12:17:51 system 12:17:51 3.8.13 12:17:51 3.9.13 12:17:51 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 12:17:51 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oeL0 from file:/tmp/.os_lf_venv 12:17:52 lf-activate-venv(): INFO: Installing: lftools 12:18:08 lf-activate-venv(): INFO: Adding /tmp/venv-oeL0/bin to PATH 12:18:08 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6104895107514803344.sh 12:18:08 ---> sudo-logs.sh 12:18:08 Archiving 'sudo' log.. 12:18:08 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins3783005152046861497.sh 12:18:08 ---> job-cost.sh 12:18:08 Setup pyenv: 12:18:09 system 12:18:09 3.8.13 12:18:09 3.9.13 12:18:09 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 12:18:09 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oeL0 from file:/tmp/.os_lf_venv 12:18:10 lf-activate-venv(): INFO: Installing: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 12:18:19 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. 12:18:19 lftools 0.37.8 requires openstacksdk<1.5.0, but you have openstacksdk 2.1.0 which is incompatible. 12:18:20 lf-activate-venv(): INFO: Adding /tmp/venv-oeL0/bin to PATH 12:18:20 INFO: No Stack... 12:18:20 INFO: Retrieving Pricing Info for: v3-standard-4 12:18:20 INFO: Archiving Costs 12:18:20 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins12496938669932019758.sh 12:18:20 ---> logs-deploy.sh 12:18:20 Setup pyenv: 12:18:20 system 12:18:20 3.8.13 12:18:20 3.9.13 12:18:20 * 3.10.6 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 12:18:20 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-oeL0 from file:/tmp/.os_lf_venv 12:18:22 lf-activate-venv(): INFO: Installing: lftools 12:18:34 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. 12:18:34 python-openstackclient 6.4.0 requires openstacksdk>=2.0.0, but you have openstacksdk 1.4.0 which is incompatible. 12:18:35 lf-activate-venv(): INFO: Adding /tmp/venv-oeL0/bin to PATH 12:18:35 WARNING: Nexus logging server not set 12:18:35 INFO: S3 path logs/releng/vex-yul-odl-jenkins-1/transportpce-tox-verify-transportpce-master/1265/ 12:18:35 INFO: archiving logs to S3 12:18:36 ---> uname -a: 12:18:36 Linux prd-centos8-builder-4c-16g-17907.novalocal 4.18.0-535.el8.x86_64 #1 SMP Sun Jan 14 23:40:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 12:18:36 12:18:36 12:18:36 ---> lscpu: 12:18:36 Architecture: x86_64 12:18:36 CPU op-mode(s): 32-bit, 64-bit 12:18:36 Byte Order: Little Endian 12:18:36 CPU(s): 4 12:18:36 On-line CPU(s) list: 0-3 12:18:36 Thread(s) per core: 1 12:18:36 Core(s) per socket: 1 12:18:36 Socket(s): 4 12:18:36 NUMA node(s): 1 12:18:36 Vendor ID: AuthenticAMD 12:18:36 CPU family: 23 12:18:36 Model: 49 12:18:36 Model name: AMD EPYC-Rome Processor 12:18:36 Stepping: 0 12:18:36 CPU MHz: 2799.996 12:18:36 BogoMIPS: 5599.99 12:18:36 Virtualization: AMD-V 12:18:36 Hypervisor vendor: KVM 12:18:36 Virtualization type: full 12:18:36 L1d cache: 32K 12:18:36 L1i cache: 32K 12:18:36 L2 cache: 512K 12:18:36 L3 cache: 16384K 12:18:36 NUMA node0 CPU(s): 0-3 12:18:36 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 xsaves clzero xsaveerptr wbnoinvd arat npt nrip_save umip rdpid arch_capabilities 12:18:36 12:18:36 12:18:36 ---> nproc: 12:18:36 4 12:18:36 12:18:36 12:18:36 ---> df -h: 12:18:36 Filesystem Size Used Avail Use% Mounted on 12:18:36 devtmpfs 7.7G 0 7.7G 0% /dev 12:18:36 tmpfs 7.7G 0 7.7G 0% /dev/shm 12:18:36 tmpfs 7.7G 17M 7.7G 1% /run 12:18:36 tmpfs 7.7G 0 7.7G 0% /sys/fs/cgroup 12:18:36 /dev/vda1 80G 18G 63G 22% / 12:18:36 tmpfs 1.6G 0 1.6G 0% /run/user/1001 12:18:36 12:18:36 12:18:36 ---> free -m: 12:18:36 total used free shared buff/cache available 12:18:36 Mem: 15761 971 6567 18 8221 14440 12:18:36 Swap: 1023 9 1014 12:18:36 12:18:36 12:18:36 ---> ip addr: 12:18:36 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 12:18:36 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 12:18:36 inet 127.0.0.1/8 scope host lo 12:18:36 valid_lft forever preferred_lft forever 12:18:36 inet6 ::1/128 scope host 12:18:36 valid_lft forever preferred_lft forever 12:18:36 2: eth0: mtu 1458 qdisc mq state UP group default qlen 1000 12:18:36 link/ether fa:16:3e:e2:54:ee brd ff:ff:ff:ff:ff:ff 12:18:36 altname enp0s3 12:18:36 altname ens3 12:18:36 inet 10.30.170.184/23 brd 10.30.171.255 scope global dynamic noprefixroute eth0 12:18:36 valid_lft 81529sec preferred_lft 81529sec 12:18:36 inet6 fe80::f816:3eff:fee2:54ee/64 scope link 12:18:36 valid_lft forever preferred_lft forever 12:18:36 3: docker0: mtu 1500 qdisc noqueue state DOWN group default 12:18:36 link/ether 02:42:98:e8:09:9e brd ff:ff:ff:ff:ff:ff 12:18:36 inet 10.250.0.254/24 brd 10.250.0.255 scope global docker0 12:18:36 valid_lft forever preferred_lft forever 12:18:36 12:18:36 12:18:36 ---> sar -b -r -n DEV: 12:18:36 Linux 4.18.0-535.el8.x86_64 (centos-stream-8-builder-01553518-6ad5-4af7-aad7-8a6b223c35ad.nov) 01/19/2024 _x86_64_ (4 CPU) 12:18:36 12:18:36 10:57:20 LINUX RESTART (4 CPU) 12:18:36 12:18:36 10:58:02 AM tps rtps wtps bread/s bwrtn/s 12:18:36 10:59:01 AM 84.26 13.89 70.37 2257.97 6372.23 12:18:36 11:00:01 AM 145.79 2.40 143.39 362.21 15347.18 12:18:36 11:01:01 AM 182.11 37.59 144.53 3953.11 17974.17 12:18:36 11:02:01 AM 375.56 100.48 275.07 2164.42 37395.98 12:18:36 11:03:01 AM 249.77 79.92 169.84 753.88 16689.12 12:18:36 11:04:01 AM 244.04 0.07 243.97 14.52 102912.99 12:18:36 11:05:01 AM 220.33 2.03 218.30 115.12 129157.98 12:18:36 11:06:01 AM 107.48 1.02 106.46 113.54 22284.51 12:18:36 11:07:01 AM 134.33 4.73 129.60 703.75 1666.97 12:18:36 11:08:01 AM 88.72 0.28 88.44 56.11 1055.16 12:18:36 11:09:01 AM 91.92 0.73 91.19 206.86 2043.70 12:18:36 11:10:01 AM 86.68 0.30 86.38 8.66 9737.99 12:18:36 11:11:01 AM 11.72 0.55 11.17 105.36 106.48 12:18:36 11:12:01 AM 10.10 0.00 10.10 0.00 74.98 12:18:36 11:13:01 AM 11.85 0.70 11.15 8.67 74.14 12:18:36 11:14:01 AM 62.13 0.00 62.13 0.00 1186.53 12:18:36 11:15:01 AM 83.98 0.02 83.96 0.14 811.32 12:18:36 11:16:01 AM 8.26 0.00 8.26 0.00 74.41 12:18:36 11:17:01 AM 4.32 0.03 4.28 0.27 40.72 12:18:36 11:18:01 AM 46.46 2.65 43.81 185.24 769.12 12:18:36 11:19:01 AM 135.59 0.83 134.76 25.20 11684.30 12:18:36 11:20:01 AM 76.38 0.00 76.38 0.00 933.90 12:18:36 11:21:01 AM 11.70 0.03 11.66 1.20 72.83 12:18:36 11:22:01 AM 16.66 0.07 16.59 1.07 91.92 12:18:36 11:23:01 AM 72.74 0.00 72.74 0.00 852.12 12:18:36 11:24:01 AM 16.68 0.02 16.66 0.13 111.35 12:18:36 11:25:01 AM 30.59 0.07 30.52 1.07 317.85 12:18:36 11:26:01 AM 67.21 0.00 67.21 0.00 598.47 12:18:36 11:27:01 AM 89.90 0.00 89.90 0.00 3398.40 12:18:36 11:28:01 AM 31.18 0.00 31.18 0.00 490.18 12:18:36 11:29:01 AM 98.60 0.02 98.58 0.13 1152.56 12:18:36 11:30:01 AM 60.20 0.00 60.20 0.00 694.05 12:18:36 11:31:01 AM 25.00 0.32 24.69 6.53 263.18 12:18:36 11:32:01 AM 59.68 0.00 59.68 0.00 765.43 12:18:36 11:33:01 AM 55.93 0.00 55.93 0.00 641.72 12:18:36 11:34:01 AM 74.84 0.00 74.84 0.00 932.63 12:18:36 11:35:01 AM 129.31 0.00 129.31 0.00 1469.42 12:18:36 11:36:01 AM 20.88 0.00 20.88 0.00 134.47 12:18:36 11:37:01 AM 66.73 0.00 66.73 0.00 1039.36 12:18:36 11:38:01 AM 73.80 0.00 73.80 0.00 699.05 12:18:36 11:39:01 AM 83.19 0.00 83.19 0.00 1057.61 12:18:36 11:40:01 AM 35.25 0.00 35.25 0.00 216.71 12:18:36 11:41:01 AM 23.88 0.02 23.86 0.13 148.85 12:18:36 11:42:01 AM 73.81 0.00 73.81 0.00 895.43 12:18:36 11:43:01 AM 24.83 0.00 24.83 0.00 171.90 12:18:36 11:44:01 AM 14.43 0.00 14.43 0.00 110.18 12:18:36 11:45:01 AM 16.48 0.00 16.48 0.00 111.16 12:18:36 11:46:01 AM 17.69 0.00 17.69 0.00 116.01 12:18:36 11:47:01 AM 14.01 0.07 13.95 0.53 104.35 12:18:36 11:48:01 AM 6.30 0.00 6.30 0.00 52.95 12:18:36 11:49:01 AM 13.35 0.00 13.35 0.00 88.50 12:18:36 11:50:01 AM 76.22 0.00 76.22 0.00 996.35 12:18:36 11:51:02 AM 21.58 0.00 21.58 0.00 159.32 12:18:36 11:52:01 AM 21.96 0.00 21.96 0.00 127.25 12:18:36 11:53:01 AM 12.31 0.05 12.26 0.40 97.62 12:18:36 11:54:01 AM 10.73 0.07 10.66 0.53 85.82 12:18:36 11:55:01 AM 15.99 0.00 15.99 0.00 98.85 12:18:36 11:56:01 AM 19.36 0.12 19.25 0.93 136.48 12:18:36 11:57:01 AM 32.31 0.02 32.29 0.13 741.57 12:18:36 11:58:01 AM 31.11 0.00 31.11 0.00 319.18 12:18:36 11:59:01 AM 16.26 0.00 16.26 0.00 92.52 12:18:36 12:00:01 PM 8.15 0.52 7.63 4.27 84.62 12:18:36 12:01:01 PM 6.90 0.42 6.48 3.87 55.06 12:18:36 12:02:01 PM 15.84 0.02 15.83 0.40 99.87 12:18:36 12:03:01 PM 11.73 0.00 11.73 0.00 86.49 12:18:36 12:04:01 PM 13.40 0.00 13.40 0.00 96.50 12:18:36 12:05:01 PM 23.50 0.02 23.48 0.27 264.64 12:18:36 12:06:01 PM 62.58 0.00 62.58 0.00 1109.06 12:18:36 12:07:01 PM 15.01 0.00 15.01 0.00 97.84 12:18:36 12:08:01 PM 17.44 0.00 17.44 0.00 127.72 12:18:36 12:09:01 PM 5.35 0.00 5.35 0.00 47.33 12:18:36 12:10:01 PM 9.90 0.00 9.90 0.00 63.65 12:18:36 12:11:01 PM 2.82 0.02 2.80 0.13 32.73 12:18:36 12:12:01 PM 6.76 0.00 6.76 0.00 59.60 12:18:36 12:13:01 PM 7.75 0.00 7.75 0.00 57.41 12:18:36 12:14:01 PM 10.95 0.00 10.95 0.00 76.79 12:18:36 12:15:01 PM 20.05 0.30 19.75 97.00 346.60 12:18:36 12:16:01 PM 75.38 0.00 75.38 0.00 14447.36 12:18:36 12:17:01 PM 35.22 11.33 23.89 420.79 517.71 12:18:36 12:18:01 PM 107.02 13.03 93.98 1614.53 28244.54 12:18:36 Average: 56.26 3.44 52.83 164.55 5554.65 12:18:36 12:18:36 10:58:02 AM kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 12:18:36 10:59:01 AM 13256720 15110792 2882728 17.86 2688 2069656 1118636 6.51 195264 2336308 159980 12:18:36 11:00:01 AM 12457140 14776148 3682308 22.82 2688 2518960 1590860 9.26 443296 2817764 285852 12:18:36 11:01:01 AM 11356836 14611416 4782612 29.63 2688 3413492 1654840 9.63 616192 3654448 785160 12:18:36 11:02:01 AM 10103880 13831600 6035568 37.40 2688 3845640 2258936 13.14 713820 4721404 142752 12:18:36 11:03:01 AM 9217232 14702152 6922216 42.89 2688 5565216 1469532 8.55 1043044 5221360 1408588 12:18:36 11:04:01 AM 4867436 12646512 11272012 69.84 2688 7807972 3736196 21.74 1626480 8893956 1136084 12:18:36 11:05:01 AM 3630580 13244524 12508868 77.50 2688 9612712 3098228 18.03 2384980 9313044 599460 12:18:36 11:06:01 AM 166272 9052600 15973176 98.97 2636 8888068 8239868 47.94 2527084 12613736 444 12:18:36 11:07:01 AM 161704 8008800 15977744 99.00 2636 7847436 9206440 53.56 2628788 12506732 424 12:18:36 11:08:01 AM 1610180 9327200 14529268 90.02 2636 7717312 7531852 43.82 2641812 11048548 196 12:18:36 11:09:01 AM 4924516 12890768 11214932 69.49 2636 7959416 3609612 21.00 2677228 7712592 232968 12:18:36 11:10:01 AM 651888 8735656 15487560 95.96 2636 8075368 7932572 46.15 2715252 11916776 816 12:18:36 11:11:01 AM 550376 8637916 15589072 96.59 2636 8078956 7979856 46.43 2716932 12017892 180 12:18:36 11:12:01 AM 465008 8552900 15674440 97.12 2636 8079308 7979856 46.43 2717020 12103176 208 12:18:36 11:13:01 AM 311856 8400488 15827592 98.07 2636 8079828 8052524 46.85 2717328 12256024 352 12:18:36 11:14:01 AM 4103792 12192392 12035656 74.57 2636 8080212 4027096 23.43 2841704 8362684 492 12:18:36 11:15:01 AM 703700 8793880 15435748 95.64 2636 8080836 8008948 46.60 2844084 11736296 588 12:18:36 11:16:01 AM 665112 8755544 15474336 95.88 2636 8081052 8043336 46.80 2844264 11775744 176 12:18:36 11:17:01 AM 620980 8712040 15518468 96.15 2636 8081916 8078160 47.00 2844716 11819264 260 12:18:36 11:18:01 AM 166640 7720260 15972808 98.97 2636 7544732 9406944 54.73 2864404 12252460 580 12:18:36 11:19:01 AM 1266184 9061984 14873264 92.15 2636 7777444 8054776 46.86 2945856 11059568 1480 12:18:36 11:20:01 AM 1641316 9437516 14498132 89.83 2636 7777776 7084172 41.22 3072248 10558932 104 12:18:36 11:21:01 AM 1611088 9407432 14528360 90.02 2636 7777884 7100572 41.31 3072520 10589156 108 12:18:36 11:22:01 AM 1524488 9320956 14614960 90.55 2636 7778004 7166104 41.69 3072636 10673844 144 12:18:36 11:23:01 AM 727400 8524356 15412048 95.49 2636 7778412 7930736 46.14 3082844 11457452 176 12:18:36 11:24:01 AM 670268 8467400 15469180 95.85 2636 7778564 7963144 46.33 3082952 11514716 52 12:18:36 11:25:01 AM 2359780 10157068 13779668 85.38 2636 7778732 6454868 37.55 3084036 9831836 428 12:18:36 11:26:01 AM 1128872 8926448 15010576 93.01 2636 7778968 7580320 44.10 3084040 11056508 100 12:18:36 11:27:01 AM 421560 8293620 15717888 97.39 2636 7848348 8592664 49.99 3084764 11751440 324 12:18:36 11:28:01 AM 1008460 8880824 15130988 93.75 2636 7848636 7908040 46.01 3088212 11164532 516 12:18:36 11:29:01 AM 2927360 10800044 13212088 81.86 2636 7848856 5924360 34.47 3097228 9247808 500 12:18:36 11:30:01 AM 437076 8310616 15702372 97.29 2636 7849196 8321644 48.42 3097260 11721608 132 12:18:36 11:31:01 AM 3623116 11496680 12516332 77.55 2636 7849232 4758384 27.68 3098128 8552580 292 12:18:36 11:32:01 AM 3419364 11293372 12720084 78.81 2636 7849652 4982072 28.99 3098388 8756380 224 12:18:36 11:33:01 AM 2447628 10321944 13691820 84.83 2636 7849936 6002268 34.92 3098612 9720284 56 12:18:36 11:34:01 AM 2609216 10484124 13530232 83.83 2636 7850232 6404144 37.26 3099552 9556928 472 12:18:36 11:35:01 AM 1459652 9335972 14679796 90.96 2636 7851012 7275056 42.33 3100004 10698424 436 12:18:36 11:36:01 AM 1160652 9037368 14978796 92.81 2636 7851324 7290840 42.42 3100004 10996780 272 12:18:36 11:37:01 AM 1210592 9087640 14928856 92.50 2636 7851552 8715968 50.71 3100328 10949792 660 12:18:36 11:38:01 AM 2981912 10860032 13157536 81.52 2636 7852096 5613224 32.66 3101120 9181380 396 12:18:36 11:39:01 AM 161580 7126316 15977868 99.00 2636 6940028 9719640 56.55 3104912 11982864 500 12:18:36 11:40:01 AM 172084 7053256 15967364 98.93 2636 6856612 9785676 56.93 3106612 11970536 460 12:18:36 11:41:01 AM 4051432 10849324 12088016 74.90 2636 6774356 5347724 31.11 3107880 8110680 328 12:18:36 11:42:01 AM 539444 7338116 15600004 96.66 2636 6775176 9286144 54.03 3108040 11602684 524 12:18:36 11:43:01 AM 341456 7140824 15797992 97.88 2636 6775872 9463600 55.06 3108044 11799344 324 12:18:36 11:44:01 AM 300932 7100764 15838516 98.14 2636 6776336 9463600 55.06 3108044 11839760 240 12:18:36 11:45:01 AM 163864 6909228 15975584 98.98 2636 6721892 9479820 55.15 3108364 11976976 356 12:18:36 11:46:01 AM 4334204 10944816 11805244 73.15 2636 6587400 5392476 31.37 3109324 7826092 52 12:18:36 11:47:01 AM 4319784 10930864 11819664 73.23 2636 6587868 5392476 31.37 3109348 7840588 188 12:18:36 11:48:01 AM 4306864 10918044 11832584 73.31 2636 6587968 5392476 31.37 3109348 7853760 36 12:18:36 11:49:01 AM 4281880 10893320 11857568 73.47 2636 6588228 5392476 31.37 3109348 7878720 56 12:18:36 11:50:01 AM 4714400 11325620 11425048 70.79 2636 6588244 5239512 30.48 3109400 7449328 288 12:18:36 11:51:02 AM 4553260 11165104 11586188 71.79 2636 6588864 5286840 30.76 3109428 7609444 96 12:18:36 11:52:01 AM 4496776 11109076 11642672 72.14 2636 6589320 5286840 30.76 3109428 7665728 300 12:18:36 11:53:01 AM 4322808 10935520 11816640 73.22 2636 6589732 5302700 30.85 3109444 7839616 112 12:18:36 11:54:01 AM 4314148 10927320 11825300 73.27 2636 6590160 5302700 30.85 3109456 7847648 40 12:18:36 11:55:01 AM 4300856 10914540 11838592 73.35 2636 6590628 5318476 30.94 3109456 7860656 220 12:18:36 11:56:01 AM 4285732 10900272 11853716 73.45 2636 6591448 5318476 30.94 3109484 7875604 400 12:18:36 11:57:01 AM 5909880 12524564 10229568 63.38 2636 6591576 4339388 25.25 3109516 6263644 500 12:18:36 11:58:01 AM 3308236 9922880 12831212 79.50 2636 6591312 6682992 38.88 3109592 8847660 140 12:18:36 11:59:01 AM 3154420 9769604 12985028 80.46 2636 6591724 6746560 39.25 3109592 9000292 476 12:18:36 12:00:01 PM 3066292 9681820 13073156 81.00 2636 6592020 6798560 39.55 3109720 9087052 64 12:18:36 12:01:01 PM 3004560 9620276 13134888 81.38 2636 6592160 6798560 39.55 3109836 9148332 84 12:18:36 12:02:01 PM 2791812 9407944 13347636 82.70 2636 6592512 6798560 39.55 3109856 9361016 248 12:18:36 12:03:01 PM 2696404 9312728 13443044 83.29 2636 6592720 6798560 39.55 3109856 9456108 104 12:18:36 12:04:01 PM 2688800 9305512 13450648 83.34 2636 6593108 6815064 39.65 3109856 9463712 72 12:18:36 12:05:01 PM 7494928 14111664 8644520 53.56 2636 6593192 1964172 11.43 3109776 4685720 268 12:18:36 12:06:01 PM 3428228 10045116 12711220 78.76 2636 6593252 6667656 38.79 3109880 8726916 456 12:18:36 12:07:01 PM 3352264 9969344 12787184 79.23 2636 6593392 6715788 39.07 3109880 8802128 208 12:18:36 12:08:01 PM 3191488 9809392 12947960 80.23 2636 6594072 6747432 39.26 3109880 8962272 48 12:18:36 12:09:01 PM 3143920 9761952 12995528 80.52 2636 6594184 6747432 39.26 3109880 9009164 52 12:18:36 12:10:01 PM 2970676 9588948 13168772 81.59 2636 6594392 6784812 39.47 3109880 9182404 212 12:18:36 12:11:01 PM 2902808 9521156 13236640 82.01 2636 6594468 6784812 39.47 3109880 9249960 48 12:18:36 12:12:01 PM 2895912 9514476 13243536 82.06 2636 6594684 6784812 39.47 3109880 9256916 76 12:18:36 12:13:01 PM 2890844 9509580 13248604 82.09 2636 6594860 6784812 39.47 3109880 9261672 112 12:18:36 12:14:01 PM 2860336 9479336 13279112 82.28 2636 6595104 6800604 39.57 3109880 9292020 68 12:18:36 12:15:01 PM 7955640 14763476 8183808 50.71 2636 6773800 1576396 9.17 3088012 4233244 225996 12:18:36 12:16:01 PM 3852296 10943872 12287152 76.13 2636 7055104 5107288 29.71 3182964 8213428 440 12:18:36 12:17:01 PM 7391796 14575044 8747652 54.20 2636 7140884 1508308 8.78 3314680 4552580 76056 12:18:36 12:18:01 PM 6794040 14804228 9345408 57.90 2636 7959696 1138920 6.63 3521332 4932992 37248 12:18:36 Average: 3204186 10257928 12935262 80.15 2641 7044529 6240135 36.31 2866291 9224243 63874 12:18:36 12:18:36 10:58:02 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 12:18:36 10:59:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 10:59:01 AM eth0 138.07 105.74 1224.54 13.43 0.00 0.00 0.00 0.00 12:18:36 10:59:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:00:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:00:01 AM eth0 179.22 136.29 2283.88 16.60 0.00 0.00 0.00 0.00 12:18:36 11:00:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:01:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:01:01 AM eth0 198.17 158.33 2705.81 17.78 0.00 0.00 0.00 0.00 12:18:36 11:01:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:02:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:02:01 AM eth0 321.27 258.65 4721.27 36.25 0.00 0.00 0.00 0.00 12:18:36 11:02:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:03:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:03:01 AM eth0 313.65 224.89 5249.77 29.04 0.00 0.00 0.00 0.00 12:18:36 11:03:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:04:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:04:01 AM eth0 312.76 146.95 7718.50 14.48 0.00 0.00 0.00 0.00 12:18:36 11:04:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:05:01 AM lo 1.48 1.48 0.14 0.14 0.00 0.00 0.00 0.00 12:18:36 11:05:01 AM eth0 1.90 2.30 0.89 0.78 0.00 0.00 0.00 0.00 12:18:36 11:05:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:06:01 AM lo 5.73 5.73 13.94 13.94 0.00 0.00 0.00 0.00 12:18:36 11:06:01 AM eth0 1.57 1.63 0.25 0.21 0.00 0.00 0.00 0.00 12:18:36 11:06:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:07:01 AM lo 47.68 47.68 36.71 36.71 0.00 0.00 0.00 0.00 12:18:36 11:07:01 AM eth0 1.52 1.67 0.28 0.26 0.00 0.00 0.00 0.00 12:18:36 11:07:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:08:01 AM lo 34.26 34.26 18.16 18.16 0.00 0.00 0.00 0.00 12:18:36 11:08:01 AM eth0 1.37 1.48 0.29 0.27 0.00 0.00 0.00 0.00 12:18:36 11:08:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:09:01 AM lo 9.01 9.01 3.41 3.41 0.00 0.00 0.00 0.00 12:18:36 11:09:01 AM eth0 2.48 2.73 1.00 0.85 0.00 0.00 0.00 0.00 12:18:36 11:09:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:10:01 AM lo 19.95 19.95 22.29 22.29 0.00 0.00 0.00 0.00 12:18:36 11:10:01 AM eth0 0.80 0.77 0.11 0.08 0.00 0.00 0.00 0.00 12:18:36 11:10:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:11:01 AM lo 19.21 19.21 10.22 10.22 0.00 0.00 0.00 0.00 12:18:36 11:11:01 AM eth0 0.53 0.52 0.10 0.10 0.00 0.00 0.00 0.00 12:18:36 11:11:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:12:01 AM lo 18.11 18.11 8.82 8.82 0.00 0.00 0.00 0.00 12:18:36 11:12:01 AM eth0 0.33 0.25 0.05 0.04 0.00 0.00 0.00 0.00 12:18:36 11:12:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:13:01 AM lo 23.53 23.53 9.02 9.02 0.00 0.00 0.00 0.00 12:18:36 11:13:01 AM eth0 0.58 0.62 0.16 0.15 0.00 0.00 0.00 0.00 12:18:36 11:13:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:14:01 AM lo 6.64 6.64 0.85 0.85 0.00 0.00 0.00 0.00 12:18:36 11:14:01 AM eth0 1.78 1.88 0.30 0.32 0.00 0.00 0.00 0.00 12:18:36 11:14:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:15:01 AM lo 30.71 30.71 13.16 13.16 0.00 0.00 0.00 0.00 12:18:36 11:15:01 AM eth0 1.59 1.07 0.45 0.32 0.00 0.00 0.00 0.00 12:18:36 11:15:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:16:01 AM lo 12.53 12.53 5.80 5.80 0.00 0.00 0.00 0.00 12:18:36 11:16:01 AM eth0 0.60 0.53 0.11 0.10 0.00 0.00 0.00 0.00 12:18:36 11:16:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:17:01 AM lo 10.46 10.46 7.73 7.73 0.00 0.00 0.00 0.00 12:18:36 11:17:01 AM eth0 1.07 0.92 0.20 0.18 0.00 0.00 0.00 0.00 12:18:36 11:17:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:18:01 AM lo 38.30 38.30 13.99 13.99 0.00 0.00 0.00 0.00 12:18:36 11:18:01 AM eth0 3.55 3.85 1.72 0.53 0.00 0.00 0.00 0.00 12:18:36 11:18:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:19:01 AM lo 13.28 13.28 19.96 19.96 0.00 0.00 0.00 0.00 12:18:36 11:19:01 AM eth0 45.99 22.68 682.96 2.18 0.00 0.00 0.00 0.00 12:18:36 11:19:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:20:01 AM lo 8.46 8.46 2.69 2.69 0.00 0.00 0.00 0.00 12:18:36 11:20:01 AM eth0 0.83 0.83 0.16 0.15 0.00 0.00 0.00 0.00 12:18:36 11:20:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:21:01 AM lo 24.69 24.69 7.23 7.23 0.00 0.00 0.00 0.00 12:18:36 11:21:01 AM eth0 1.68 1.02 0.28 0.19 0.00 0.00 0.00 0.00 12:18:36 11:21:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:22:01 AM lo 31.72 31.72 11.83 11.83 0.00 0.00 0.00 0.00 12:18:36 11:22:01 AM eth0 4.32 2.30 1.92 0.87 0.00 0.00 0.00 0.00 12:18:36 11:22:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:23:01 AM lo 6.33 6.33 2.70 2.70 0.00 0.00 0.00 0.00 12:18:36 11:23:01 AM eth0 1.18 0.83 0.50 0.39 0.00 0.00 0.00 0.00 12:18:36 11:23:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:24:01 AM lo 33.61 33.61 10.17 10.17 0.00 0.00 0.00 0.00 12:18:36 11:24:01 AM eth0 1.83 1.02 0.36 0.25 0.00 0.00 0.00 0.00 12:18:36 11:24:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:25:01 AM lo 27.92 27.92 10.16 10.16 0.00 0.00 0.00 0.00 12:18:36 11:25:01 AM eth0 2.31 1.76 0.88 0.69 0.00 0.00 0.00 0.00 12:18:36 11:25:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:26:01 AM lo 25.36 25.36 8.28 8.28 0.00 0.00 0.00 0.00 12:18:36 11:26:01 AM eth0 0.83 0.67 0.14 0.12 0.00 0.00 0.00 0.00 12:18:36 11:26:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:27:01 AM lo 8.56 8.56 3.01 3.01 0.00 0.00 0.00 0.00 12:18:36 11:27:01 AM eth0 2.20 2.23 0.93 0.80 0.00 0.00 0.00 0.00 12:18:36 11:27:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:28:01 AM lo 10.98 10.98 8.68 8.68 0.00 0.00 0.00 0.00 12:18:36 11:28:01 AM eth0 1.87 1.68 0.42 0.37 0.00 0.00 0.00 0.00 12:18:36 11:28:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:29:01 AM lo 23.60 23.60 9.19 9.19 0.00 0.00 0.00 0.00 12:18:36 11:29:01 AM eth0 1.63 1.85 0.29 0.28 0.00 0.00 0.00 0.00 12:18:36 11:29:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:30:01 AM lo 25.67 25.67 12.75 12.75 0.00 0.00 0.00 0.00 12:18:36 11:30:01 AM eth0 1.35 1.50 0.44 0.39 0.00 0.00 0.00 0.00 12:18:36 11:30:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:31:01 AM lo 11.42 11.42 4.24 4.24 0.00 0.00 0.00 0.00 12:18:36 11:31:01 AM eth0 1.08 0.95 0.21 0.19 0.00 0.00 0.00 0.00 12:18:36 11:31:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:32:01 AM lo 5.26 5.26 6.37 6.37 0.00 0.00 0.00 0.00 12:18:36 11:32:01 AM eth0 0.83 0.70 0.14 0.12 0.00 0.00 0.00 0.00 12:18:36 11:32:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:33:01 AM lo 21.78 21.78 8.43 8.43 0.00 0.00 0.00 0.00 12:18:36 11:33:01 AM eth0 1.12 1.05 0.28 0.24 0.00 0.00 0.00 0.00 12:18:36 11:33:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:34:01 AM lo 18.52 18.52 8.27 8.27 0.00 0.00 0.00 0.00 12:18:36 11:34:01 AM eth0 1.51 1.55 0.26 0.24 0.00 0.00 0.00 0.00 12:18:36 11:34:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:35:01 AM lo 54.51 54.51 24.28 24.28 0.00 0.00 0.00 0.00 12:18:36 11:35:01 AM eth0 1.33 1.70 0.25 0.25 0.00 0.00 0.00 0.00 12:18:36 11:35:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:36:01 AM lo 50.28 50.28 17.28 17.28 0.00 0.00 0.00 0.00 12:18:36 11:36:01 AM eth0 1.48 2.02 0.30 0.31 0.00 0.00 0.00 0.00 12:18:36 11:36:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:37:01 AM lo 10.26 10.26 12.64 12.64 0.00 0.00 0.00 0.00 12:18:36 11:37:01 AM eth0 2.50 1.55 0.42 0.26 0.00 0.00 0.00 0.00 12:18:36 11:37:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:38:01 AM lo 58.90 58.90 26.42 26.42 0.00 0.00 0.00 0.00 12:18:36 11:38:01 AM eth0 2.18 1.92 1.05 0.74 0.00 0.00 0.00 0.00 12:18:36 11:38:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:39:01 AM lo 44.43 44.43 16.44 16.44 0.00 0.00 0.00 0.00 12:18:36 11:39:01 AM eth0 1.25 1.48 0.23 0.21 0.00 0.00 0.00 0.00 12:18:36 11:39:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:40:01 AM lo 73.93 73.93 24.69 24.69 0.00 0.00 0.00 0.00 12:18:36 11:40:01 AM eth0 0.93 1.30 0.19 0.20 0.00 0.00 0.00 0.00 12:18:36 11:40:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:41:01 AM lo 38.77 38.77 11.74 11.74 0.00 0.00 0.00 0.00 12:18:36 11:41:01 AM eth0 0.67 0.88 0.14 0.14 0.00 0.00 0.00 0.00 12:18:36 11:41:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:42:01 AM lo 37.82 37.82 23.35 23.35 0.00 0.00 0.00 0.00 12:18:36 11:42:01 AM eth0 1.02 1.17 0.17 0.16 0.00 0.00 0.00 0.00 12:18:36 11:42:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:43:01 AM lo 42.43 42.43 16.20 16.20 0.00 0.00 0.00 0.00 12:18:36 11:43:01 AM eth0 0.72 0.82 0.19 0.18 0.00 0.00 0.00 0.00 12:18:36 11:43:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:44:01 AM lo 28.44 28.44 11.20 11.20 0.00 0.00 0.00 0.00 12:18:36 11:44:01 AM eth0 0.67 0.60 0.13 0.12 0.00 0.00 0.00 0.00 12:18:36 11:44:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:45:01 AM lo 32.69 32.69 14.04 14.04 0.00 0.00 0.00 0.00 12:18:36 11:45:01 AM eth0 0.45 0.38 0.09 0.08 0.00 0.00 0.00 0.00 12:18:36 11:45:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:46:01 AM lo 30.21 30.21 10.10 10.10 0.00 0.00 0.00 0.00 12:18:36 11:46:01 AM eth0 0.87 0.78 0.17 0.16 0.00 0.00 0.00 0.00 12:18:36 11:46:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:47:01 AM lo 20.61 20.61 9.82 9.82 0.00 0.00 0.00 0.00 12:18:36 11:47:01 AM eth0 1.32 0.42 0.45 0.29 0.00 0.00 0.00 0.00 12:18:36 11:47:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:48:01 AM lo 12.75 12.75 5.52 5.52 0.00 0.00 0.00 0.00 12:18:36 11:48:01 AM eth0 1.38 0.82 0.48 0.36 0.00 0.00 0.00 0.00 12:18:36 11:48:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:49:01 AM lo 24.88 24.88 10.36 10.36 0.00 0.00 0.00 0.00 12:18:36 11:49:01 AM eth0 0.53 0.38 0.08 0.07 0.00 0.00 0.00 0.00 12:18:36 11:49:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:50:01 AM lo 16.44 16.44 7.11 7.11 0.00 0.00 0.00 0.00 12:18:36 11:50:01 AM eth0 0.95 1.05 0.17 0.15 0.00 0.00 0.00 0.00 12:18:36 11:50:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:51:02 AM lo 36.58 36.58 12.36 12.36 0.00 0.00 0.00 0.00 12:18:36 11:51:02 AM eth0 0.73 0.92 0.14 0.14 0.00 0.00 0.00 0.00 12:18:36 11:51:02 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:52:01 AM lo 44.88 44.88 13.48 13.48 0.00 0.00 0.00 0.00 12:18:36 11:52:01 AM eth0 0.24 0.20 0.03 0.03 0.00 0.00 0.00 0.00 12:18:36 11:52:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:53:01 AM lo 19.88 19.88 7.32 7.32 0.00 0.00 0.00 0.00 12:18:36 11:53:01 AM eth0 0.83 0.90 0.21 0.20 0.00 0.00 0.00 0.00 12:18:36 11:53:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:54:01 AM lo 30.91 30.91 9.65 9.65 0.00 0.00 0.00 0.00 12:18:36 11:54:01 AM eth0 0.93 0.37 0.34 0.23 0.00 0.00 0.00 0.00 12:18:36 11:54:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:55:01 AM lo 32.67 32.67 9.63 9.63 0.00 0.00 0.00 0.00 12:18:36 11:55:01 AM eth0 0.65 0.05 0.07 0.00 0.00 0.00 0.00 0.00 12:18:36 11:55:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:56:01 AM lo 56.56 56.56 18.67 18.67 0.00 0.00 0.00 0.00 12:18:36 11:56:01 AM eth0 0.90 0.22 0.32 0.20 0.00 0.00 0.00 0.00 12:18:36 11:56:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:57:01 AM lo 24.36 24.36 7.00 7.00 0.00 0.00 0.00 0.00 12:18:36 11:57:01 AM eth0 1.00 0.73 0.35 0.27 0.00 0.00 0.00 0.00 12:18:36 11:57:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:58:01 AM lo 21.48 21.48 22.52 22.52 0.00 0.00 0.00 0.00 12:18:36 11:58:01 AM eth0 1.15 0.90 0.22 0.19 0.00 0.00 0.00 0.00 12:18:36 11:58:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 11:59:01 AM lo 31.89 31.89 13.58 13.58 0.00 0.00 0.00 0.00 12:18:36 11:59:01 AM eth0 2.37 0.75 0.62 0.36 0.00 0.00 0.00 0.00 12:18:36 11:59:01 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:00:01 PM lo 15.86 15.86 7.12 7.12 0.00 0.00 0.00 0.00 12:18:36 12:00:01 PM eth0 1.65 0.67 0.46 0.28 0.00 0.00 0.00 0.00 12:18:36 12:00:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:01:01 PM lo 10.71 10.71 4.81 4.81 0.00 0.00 0.00 0.00 12:18:36 12:01:01 PM eth0 2.70 1.15 1.35 0.75 0.00 0.00 0.00 0.00 12:18:36 12:01:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:02:01 PM lo 37.02 37.02 14.58 14.58 0.00 0.00 0.00 0.00 12:18:36 12:02:01 PM eth0 0.90 0.63 0.35 0.29 0.00 0.00 0.00 0.00 12:18:36 12:02:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:03:01 PM lo 18.18 18.18 6.56 6.56 0.00 0.00 0.00 0.00 12:18:36 12:03:01 PM eth0 0.73 0.55 0.19 0.16 0.00 0.00 0.00 0.00 12:18:36 12:03:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:04:01 PM lo 20.39 20.39 8.96 8.96 0.00 0.00 0.00 0.00 12:18:36 12:04:01 PM eth0 0.48 0.33 0.08 0.06 0.00 0.00 0.00 0.00 12:18:36 12:04:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:05:01 PM lo 18.33 18.33 7.86 7.86 0.00 0.00 0.00 0.00 12:18:36 12:05:01 PM eth0 0.65 0.57 0.12 0.11 0.00 0.00 0.00 0.00 12:18:36 12:05:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:06:01 PM lo 21.16 21.16 22.47 22.47 0.00 0.00 0.00 0.00 12:18:36 12:06:01 PM eth0 0.98 0.85 0.15 0.12 0.00 0.00 0.00 0.00 12:18:36 12:06:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:07:01 PM lo 19.37 19.37 7.69 7.69 0.00 0.00 0.00 0.00 12:18:36 12:07:01 PM eth0 0.75 1.00 0.20 0.15 0.00 0.00 0.00 0.00 12:18:36 12:07:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:08:01 PM lo 29.59 29.59 14.86 14.86 0.00 0.00 0.00 0.00 12:18:36 12:08:01 PM eth0 0.50 0.45 0.13 0.12 0.00 0.00 0.00 0.00 12:18:36 12:08:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:09:01 PM lo 7.70 7.70 5.18 5.18 0.00 0.00 0.00 0.00 12:18:36 12:09:01 PM eth0 0.58 0.65 0.10 0.10 0.00 0.00 0.00 0.00 12:18:36 12:09:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:10:01 PM lo 24.84 24.84 12.97 12.97 0.00 0.00 0.00 0.00 12:18:36 12:10:01 PM eth0 0.68 0.88 0.14 0.14 0.00 0.00 0.00 0.00 12:18:36 12:10:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:11:01 PM lo 4.25 4.25 3.92 3.92 0.00 0.00 0.00 0.00 12:18:36 12:11:01 PM eth0 0.72 0.65 0.12 0.11 0.00 0.00 0.00 0.00 12:18:36 12:11:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:12:01 PM lo 13.05 13.05 6.67 6.67 0.00 0.00 0.00 0.00 12:18:36 12:12:01 PM eth0 1.17 0.77 0.38 0.28 0.00 0.00 0.00 0.00 12:18:36 12:12:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:13:01 PM lo 19.76 19.76 11.99 11.99 0.00 0.00 0.00 0.00 12:18:36 12:13:01 PM eth0 0.72 0.53 0.23 0.15 0.00 0.00 0.00 0.00 12:18:36 12:13:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:14:01 PM lo 22.68 22.68 9.22 9.22 0.00 0.00 0.00 0.00 12:18:36 12:14:01 PM eth0 0.27 0.17 0.04 0.03 0.00 0.00 0.00 0.00 12:18:36 12:14:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:15:01 PM lo 19.62 19.62 7.52 7.52 0.00 0.00 0.00 0.00 12:18:36 12:15:01 PM eth0 136.49 72.67 1979.69 5.56 0.00 0.00 0.00 0.00 12:18:36 12:15:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:16:01 PM lo 0.78 0.78 0.07 0.07 0.00 0.00 0.00 0.00 12:18:36 12:16:01 PM eth0 0.37 0.30 0.04 0.03 0.00 0.00 0.00 0.00 12:18:36 12:16:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:17:01 PM lo 4.60 4.60 0.35 0.35 0.00 0.00 0.00 0.00 12:18:36 12:17:01 PM eth0 50.67 50.02 66.87 38.08 0.00 0.00 0.00 0.00 12:18:36 12:17:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:18:01 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:18:01 PM eth0 142.38 107.60 1704.52 28.78 0.00 0.00 0.00 0.00 12:18:36 12:18:01 PM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 Average: lo 21.99 21.99 10.08 10.08 0.00 0.00 0.00 0.00 12:18:36 Average: eth0 24.04 16.95 354.60 2.75 0.00 0.00 0.00 0.00 12:18:36 Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 12:18:36 12:18:36 12:18:36 ---> sar -P ALL: 12:18:36 Linux 4.18.0-535.el8.x86_64 (centos-stream-8-builder-01553518-6ad5-4af7-aad7-8a6b223c35ad.nov) 01/19/2024 _x86_64_ (4 CPU) 12:18:36 12:18:36 10:57:20 LINUX RESTART (4 CPU) 12:18:36 12:18:36 10:58:02 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 10:59:01 AM all 18.51 0.00 3.03 1.52 0.07 76.88 12:18:36 10:59:01 AM 0 14.41 0.00 2.63 1.39 0.07 81.49 12:18:36 10:59:01 AM 1 22.75 0.00 3.18 1.63 0.07 72.36 12:18:36 10:59:01 AM 2 14.88 0.00 2.32 1.26 0.09 81.45 12:18:36 10:59:01 AM 3 21.99 0.00 3.97 1.79 0.07 72.19 12:18:36 11:00:01 AM all 24.15 0.00 3.98 2.84 0.08 68.96 12:18:36 11:00:01 AM 0 21.87 0.00 4.06 2.96 0.08 71.02 12:18:36 11:00:01 AM 1 27.59 0.00 4.44 3.49 0.08 64.40 12:18:36 11:00:01 AM 2 20.10 0.00 3.93 2.44 0.07 73.46 12:18:36 11:00:01 AM 3 26.97 0.00 3.48 2.45 0.08 67.02 12:18:36 11:01:01 AM all 46.02 0.03 5.18 4.74 0.65 43.38 12:18:36 11:01:01 AM 0 34.66 0.02 4.09 5.24 1.26 54.75 12:18:36 11:01:01 AM 1 55.01 0.00 6.19 4.36 0.64 33.80 12:18:36 11:01:01 AM 2 40.49 0.03 4.46 4.36 0.12 50.54 12:18:36 11:01:01 AM 3 53.97 0.08 5.97 4.97 0.60 34.40 12:18:36 11:02:01 AM all 59.75 1.43 12.93 8.39 0.14 17.36 12:18:36 11:02:01 AM 0 58.90 1.18 13.08 9.40 0.13 17.31 12:18:36 11:02:01 AM 1 61.18 1.84 13.50 7.49 0.15 15.84 12:18:36 11:02:01 AM 2 66.51 1.07 9.74 6.24 0.15 16.28 12:18:36 11:02:01 AM 3 52.38 1.61 15.42 10.42 0.14 20.04 12:18:36 11:03:01 AM all 41.49 0.72 16.91 6.47 0.11 34.29 12:18:36 11:03:01 AM 0 34.56 1.41 26.23 10.57 0.10 27.14 12:18:36 11:03:01 AM 1 62.05 0.39 14.17 4.12 0.10 19.18 12:18:36 11:03:01 AM 2 30.78 0.52 12.52 3.96 0.12 52.10 12:18:36 11:03:01 AM 3 38.57 0.57 14.74 7.23 0.12 38.77 12:18:36 11:04:01 AM all 67.50 0.00 5.46 17.32 0.11 9.61 12:18:36 11:04:01 AM 0 63.34 0.00 5.54 19.37 0.12 11.63 12:18:36 11:04:01 AM 1 61.86 0.00 5.37 21.07 0.12 11.58 12:18:36 11:04:01 AM 2 75.48 0.00 6.13 12.65 0.10 5.64 12:18:36 11:04:01 AM 3 69.33 0.00 4.79 16.17 0.12 9.59 12:18:36 11:05:01 AM all 73.18 0.00 4.69 10.61 0.12 11.40 12:18:36 11:05:01 AM 0 92.20 0.00 3.98 1.13 0.10 2.60 12:18:36 11:05:01 AM 1 63.97 0.00 4.72 11.07 0.13 20.11 12:18:36 11:05:01 AM 2 72.00 0.00 5.12 13.75 0.12 9.01 12:18:36 11:05:01 AM 3 64.62 0.00 4.94 16.48 0.12 13.85 12:18:36 11:06:01 AM all 75.80 0.00 3.03 2.39 0.11 18.67 12:18:36 11:06:01 AM 0 79.71 0.00 2.91 4.17 0.12 13.10 12:18:36 11:06:01 AM 1 73.18 0.00 3.08 1.07 0.10 22.56 12:18:36 11:06:01 AM 2 75.00 0.00 3.02 1.29 0.12 20.58 12:18:36 11:06:01 AM 3 75.31 0.00 3.10 3.05 0.12 18.44 12:18:36 11:07:01 AM all 58.53 0.00 2.30 0.40 0.10 38.66 12:18:36 11:07:01 AM 0 61.85 0.00 2.11 0.17 0.10 35.77 12:18:36 11:07:01 AM 1 54.00 0.00 2.50 0.52 0.12 42.86 12:18:36 11:07:01 AM 2 56.70 0.00 1.98 0.18 0.10 41.04 12:18:36 11:07:01 AM 3 61.57 0.00 2.61 0.74 0.10 34.98 12:18:36 11:08:01 AM all 29.10 0.00 1.65 0.23 0.09 68.93 12:18:36 11:08:01 AM 0 31.89 0.00 1.19 0.05 0.08 66.78 12:18:36 11:08:01 AM 1 24.41 0.00 2.12 0.20 0.08 73.19 12:18:36 11:08:01 AM 2 29.95 0.00 2.02 0.15 0.10 67.78 12:18:36 11:08:01 AM 3 30.14 0.00 1.29 0.50 0.08 67.98 12:18:36 11:09:01 AM all 77.08 0.00 3.09 0.27 0.12 19.44 12:18:36 11:09:01 AM 0 81.52 0.00 2.88 0.18 0.12 15.30 12:18:36 11:09:01 AM 1 78.97 0.00 2.39 0.12 0.12 18.40 12:18:36 11:09:01 AM 2 73.55 0.00 3.56 0.22 0.13 22.54 12:18:36 11:09:01 AM 3 74.25 0.00 3.54 0.57 0.12 21.53 12:18:36 12:18:36 11:09:01 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 11:10:01 AM all 73.85 0.00 2.04 0.25 0.12 23.75 12:18:36 11:10:01 AM 0 73.06 0.00 1.95 0.12 0.17 24.70 12:18:36 11:10:01 AM 1 72.82 0.00 2.10 0.44 0.10 24.54 12:18:36 11:10:01 AM 2 75.20 0.00 1.97 0.17 0.10 22.56 12:18:36 11:10:01 AM 3 74.32 0.00 2.13 0.25 0.10 23.19 12:18:36 11:11:01 AM all 9.55 0.00 0.63 0.09 0.08 89.65 12:18:36 11:11:01 AM 0 9.07 0.00 0.62 0.08 0.07 90.16 12:18:36 11:11:01 AM 1 10.01 0.00 0.64 0.03 0.08 89.23 12:18:36 11:11:01 AM 2 9.83 0.00 0.62 0.18 0.07 89.30 12:18:36 11:11:01 AM 3 9.30 0.00 0.64 0.07 0.08 89.91 12:18:36 11:12:01 AM all 5.53 0.00 0.54 0.14 0.07 93.72 12:18:36 11:12:01 AM 0 5.44 0.00 0.50 0.30 0.07 93.69 12:18:36 11:12:01 AM 1 5.74 0.00 0.52 0.05 0.05 93.64 12:18:36 11:12:01 AM 2 5.47 0.00 0.60 0.05 0.08 93.79 12:18:36 11:12:01 AM 3 5.49 0.00 0.54 0.15 0.07 93.75 12:18:36 11:13:01 AM all 4.59 0.00 0.62 0.08 0.07 94.64 12:18:36 11:13:01 AM 0 4.70 0.00 0.55 0.05 0.05 94.64 12:18:36 11:13:01 AM 1 4.26 0.00 0.70 0.05 0.08 94.90 12:18:36 11:13:01 AM 2 4.34 0.00 0.57 0.20 0.07 94.82 12:18:36 11:13:01 AM 3 5.05 0.00 0.65 0.03 0.07 94.20 12:18:36 11:14:01 AM all 66.76 0.00 2.49 0.27 0.12 30.36 12:18:36 11:14:01 AM 0 65.69 0.00 2.75 0.22 0.13 31.21 12:18:36 11:14:01 AM 1 70.44 0.00 2.16 0.23 0.12 27.05 12:18:36 11:14:01 AM 2 66.29 0.00 2.54 0.15 0.12 30.90 12:18:36 11:14:01 AM 3 64.61 0.00 2.52 0.48 0.12 32.27 12:18:36 11:15:01 AM all 58.62 0.00 1.77 0.17 0.12 39.32 12:18:36 11:15:01 AM 0 54.97 0.00 1.97 0.12 0.12 42.82 12:18:36 11:15:01 AM 1 61.65 0.00 1.67 0.41 0.12 36.16 12:18:36 11:15:01 AM 2 57.24 0.00 1.63 0.12 0.12 40.89 12:18:36 11:15:01 AM 3 60.62 0.00 1.80 0.02 0.14 37.43 12:18:36 11:16:01 AM all 5.33 0.00 0.53 0.04 0.07 94.03 12:18:36 11:16:01 AM 0 5.27 0.00 0.49 0.00 0.07 94.18 12:18:36 11:16:01 AM 1 5.42 0.00 0.57 0.13 0.07 93.81 12:18:36 11:16:01 AM 2 5.12 0.00 0.57 0.02 0.08 94.20 12:18:36 11:16:01 AM 3 5.51 0.00 0.49 0.02 0.05 93.93 12:18:36 11:17:01 AM all 3.01 0.00 0.45 0.04 0.08 96.42 12:18:36 11:17:01 AM 0 3.40 0.00 0.33 0.02 0.07 96.18 12:18:36 11:17:01 AM 1 2.95 0.00 0.55 0.08 0.10 96.31 12:18:36 11:17:01 AM 2 3.14 0.00 0.44 0.03 0.08 96.31 12:18:36 11:17:01 AM 3 2.57 0.00 0.47 0.02 0.08 96.86 12:18:36 11:18:01 AM all 45.26 0.95 2.07 0.18 0.11 51.43 12:18:36 11:18:01 AM 0 44.51 2.70 1.89 0.13 0.12 50.65 12:18:36 11:18:01 AM 1 46.47 0.45 1.93 0.15 0.10 50.90 12:18:36 11:18:01 AM 2 44.00 0.66 2.56 0.12 0.12 52.56 12:18:36 11:18:01 AM 3 46.07 0.00 1.91 0.30 0.10 51.62 12:18:36 11:19:01 AM all 61.84 0.00 2.64 1.17 0.12 34.23 12:18:36 11:19:01 AM 0 55.59 0.00 3.17 0.81 0.12 40.32 12:18:36 11:19:01 AM 1 61.32 0.00 3.09 1.58 0.12 33.90 12:18:36 11:19:01 AM 2 58.56 0.00 2.02 0.86 0.12 38.44 12:18:36 11:19:01 AM 3 71.84 0.00 2.29 1.44 0.12 24.31 12:18:36 11:20:01 AM all 45.15 0.00 1.69 0.20 0.10 52.86 12:18:36 11:20:01 AM 0 45.28 0.00 1.68 0.03 0.10 52.91 12:18:36 11:20:01 AM 1 49.56 0.00 0.91 0.02 0.10 49.42 12:18:36 11:20:01 AM 2 43.79 0.00 2.75 0.39 0.10 52.97 12:18:36 11:20:01 AM 3 41.97 0.00 1.44 0.37 0.10 56.12 12:18:36 12:18:36 11:20:01 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 11:21:01 AM all 5.08 0.00 0.60 0.20 0.08 94.04 12:18:36 11:21:01 AM 0 4.62 0.00 0.60 0.23 0.08 94.45 12:18:36 11:21:01 AM 1 5.65 0.00 0.59 0.12 0.08 93.57 12:18:36 11:21:01 AM 2 4.92 0.00 0.66 0.37 0.08 93.97 12:18:36 11:21:01 AM 3 5.11 0.00 0.57 0.07 0.08 94.16 12:18:36 11:22:01 AM all 8.90 0.00 0.70 0.22 0.07 90.11 12:18:36 11:22:01 AM 0 8.88 0.00 0.62 0.72 0.07 89.71 12:18:36 11:22:01 AM 1 7.69 0.00 0.84 0.08 0.07 91.32 12:18:36 11:22:01 AM 2 9.05 0.00 0.74 0.07 0.08 90.06 12:18:36 11:22:01 AM 3 9.98 0.00 0.59 0.02 0.07 89.35 12:18:36 11:23:01 AM all 63.86 0.00 1.90 0.20 0.13 33.91 12:18:36 11:23:01 AM 0 63.39 0.00 1.47 0.08 0.13 34.92 12:18:36 11:23:01 AM 1 52.91 0.00 2.52 0.61 0.12 43.84 12:18:36 11:23:01 AM 2 69.96 0.00 1.61 0.03 0.12 28.28 12:18:36 11:23:01 AM 3 69.14 0.00 1.99 0.08 0.13 28.65 12:18:36 11:24:01 AM all 7.97 0.00 0.68 0.06 0.08 91.21 12:18:36 11:24:01 AM 0 7.64 0.00 0.69 0.08 0.07 91.52 12:18:36 11:24:01 AM 1 8.67 0.00 0.74 0.03 0.08 90.47 12:18:36 11:24:01 AM 2 7.88 0.00 0.64 0.05 0.08 91.35 12:18:36 11:24:01 AM 3 7.68 0.00 0.66 0.08 0.07 91.51 12:18:36 11:25:01 AM all 22.73 0.00 1.23 0.08 0.08 75.88 12:18:36 11:25:01 AM 0 17.57 0.00 1.63 0.12 0.08 80.60 12:18:36 11:25:01 AM 1 25.22 0.00 0.87 0.05 0.08 73.77 12:18:36 11:25:01 AM 2 25.22 0.00 0.82 0.03 0.08 73.84 12:18:36 11:25:01 AM 3 22.89 0.00 1.61 0.12 0.08 75.30 12:18:36 11:26:01 AM all 31.25 0.00 1.13 0.24 0.09 67.28 12:18:36 11:26:01 AM 0 32.86 0.00 1.02 0.32 0.08 65.72 12:18:36 11:26:01 AM 1 33.26 0.00 0.80 0.40 0.10 65.43 12:18:36 11:26:01 AM 2 23.60 0.00 1.26 0.15 0.08 74.90 12:18:36 11:26:01 AM 3 35.26 0.00 1.44 0.10 0.08 63.11 12:18:36 11:27:01 AM all 47.67 0.00 2.08 0.37 0.13 49.75 12:18:36 11:27:01 AM 0 46.78 0.00 2.71 0.52 0.13 49.85 12:18:36 11:27:01 AM 1 56.64 0.00 1.98 0.54 0.12 40.73 12:18:36 11:27:01 AM 2 43.03 0.00 2.20 0.39 0.13 54.24 12:18:36 11:27:01 AM 3 44.22 0.00 1.43 0.05 0.12 54.18 12:18:36 11:28:01 AM all 35.84 0.00 1.55 0.11 0.10 62.39 12:18:36 11:28:01 AM 0 37.44 0.00 1.63 0.13 0.10 60.70 12:18:36 11:28:01 AM 1 35.93 0.00 1.48 0.10 0.10 62.40 12:18:36 11:28:01 AM 2 40.15 0.00 1.12 0.03 0.10 58.59 12:18:36 11:28:01 AM 3 29.84 0.00 1.98 0.18 0.10 67.90 12:18:36 11:29:01 AM all 66.98 0.00 2.41 0.23 0.12 30.25 12:18:36 11:29:01 AM 0 69.93 0.00 1.84 0.07 0.12 28.04 12:18:36 11:29:01 AM 1 65.84 0.00 2.87 0.25 0.12 30.93 12:18:36 11:29:01 AM 2 70.46 0.00 1.94 0.55 0.12 26.93 12:18:36 11:29:01 AM 3 61.68 0.00 3.00 0.07 0.12 35.13 12:18:36 11:30:01 AM all 38.96 0.00 1.31 0.18 0.09 59.46 12:18:36 11:30:01 AM 0 39.93 0.00 1.22 0.05 0.08 58.72 12:18:36 11:30:01 AM 1 38.28 0.00 1.46 0.12 0.10 60.04 12:18:36 11:30:01 AM 2 38.98 0.00 1.24 0.32 0.08 59.38 12:18:36 11:30:01 AM 3 38.66 0.00 1.31 0.22 0.10 59.71 12:18:36 11:31:01 AM all 15.63 0.00 1.06 0.08 0.09 83.13 12:18:36 11:31:01 AM 0 15.97 0.00 1.29 0.10 0.08 82.56 12:18:36 11:31:01 AM 1 17.46 0.00 1.17 0.05 0.10 81.22 12:18:36 11:31:01 AM 2 14.56 0.00 0.79 0.02 0.08 84.55 12:18:36 11:31:01 AM 3 14.54 0.02 1.01 0.13 0.10 84.20 12:18:36 12:18:36 11:31:01 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 11:32:01 AM all 32.41 0.00 1.37 0.32 0.10 65.81 12:18:36 11:32:01 AM 0 32.13 0.00 1.14 0.15 0.08 66.49 12:18:36 11:32:01 AM 1 35.72 0.00 0.95 0.92 0.10 62.31 12:18:36 11:32:01 AM 2 30.50 0.00 1.91 0.05 0.10 67.44 12:18:36 11:32:01 AM 3 31.27 0.00 1.47 0.15 0.10 67.00 12:18:36 11:33:01 AM all 24.78 0.00 1.00 0.15 0.08 73.98 12:18:36 11:33:01 AM 0 26.40 0.00 0.70 0.03 0.08 72.78 12:18:36 11:33:01 AM 1 23.76 0.00 1.14 0.49 0.08 74.53 12:18:36 11:33:01 AM 2 25.15 0.00 1.16 0.05 0.08 73.56 12:18:36 11:33:01 AM 3 23.80 0.00 1.01 0.03 0.08 75.08 12:18:36 11:34:01 AM all 64.54 0.00 2.33 0.26 0.12 32.76 12:18:36 11:34:01 AM 0 63.87 0.00 2.13 0.12 0.12 33.77 12:18:36 11:34:01 AM 1 64.50 0.00 2.75 0.40 0.12 32.24 12:18:36 11:34:01 AM 2 69.58 0.00 2.21 0.15 0.12 27.94 12:18:36 11:34:01 AM 3 60.19 0.00 2.26 0.35 0.12 37.08 12:18:36 11:35:01 AM all 72.30 0.00 2.39 0.42 0.12 24.77 12:18:36 11:35:01 AM 0 75.70 0.00 2.11 0.50 0.12 21.57 12:18:36 11:35:01 AM 1 74.95 0.00 2.28 0.28 0.12 22.36 12:18:36 11:35:01 AM 2 69.72 0.00 2.22 0.59 0.12 27.36 12:18:36 11:35:01 AM 3 68.82 0.00 2.95 0.30 0.12 27.81 12:18:36 11:36:01 AM all 10.15 0.00 0.78 0.08 0.09 88.90 12:18:36 11:36:01 AM 0 9.88 0.00 0.79 0.07 0.08 89.18 12:18:36 11:36:01 AM 1 9.59 0.00 0.84 0.12 0.08 89.37 12:18:36 11:36:01 AM 2 10.12 0.00 0.84 0.05 0.08 88.91 12:18:36 11:36:01 AM 3 11.02 0.00 0.67 0.08 0.10 88.12 12:18:36 11:37:01 AM all 80.94 0.00 2.65 0.31 0.13 15.98 12:18:36 11:37:01 AM 0 76.33 0.00 2.54 0.22 0.12 20.79 12:18:36 11:37:01 AM 1 84.97 0.00 2.46 0.30 0.12 12.15 12:18:36 11:37:01 AM 2 81.90 0.00 2.71 0.23 0.15 15.01 12:18:36 11:37:01 AM 3 80.54 0.00 2.89 0.47 0.13 15.96 12:18:36 11:38:01 AM all 37.57 0.00 1.44 0.16 0.11 60.73 12:18:36 11:38:01 AM 0 36.47 0.00 1.53 0.20 0.12 61.69 12:18:36 11:38:01 AM 1 37.55 0.00 1.51 0.05 0.10 60.79 12:18:36 11:38:01 AM 2 37.75 0.00 1.45 0.32 0.10 60.39 12:18:36 11:38:01 AM 3 38.52 0.00 1.27 0.05 0.12 60.04 12:18:36 11:39:01 AM all 54.91 0.00 2.22 0.22 0.10 42.54 12:18:36 11:39:01 AM 0 61.14 0.00 1.96 0.12 0.10 36.68 12:18:36 11:39:01 AM 1 49.49 0.00 2.43 0.23 0.12 47.73 12:18:36 11:39:01 AM 2 57.45 0.00 2.55 0.47 0.10 39.43 12:18:36 11:39:01 AM 3 51.55 0.00 1.95 0.07 0.10 46.33 12:18:36 11:40:01 AM all 13.96 0.00 0.90 0.10 0.10 84.94 12:18:36 11:40:01 AM 0 12.69 0.00 1.01 0.12 0.10 86.08 12:18:36 11:40:01 AM 1 14.02 0.00 0.92 0.10 0.08 84.87 12:18:36 11:40:01 AM 2 14.80 0.00 0.77 0.08 0.10 84.24 12:18:36 11:40:01 AM 3 14.33 0.00 0.89 0.10 0.10 84.58 12:18:36 11:41:01 AM all 5.97 0.00 0.86 0.18 0.09 92.90 12:18:36 11:41:01 AM 0 5.43 0.00 0.97 0.10 0.08 93.41 12:18:36 11:41:01 AM 1 5.85 0.00 0.89 0.07 0.08 93.11 12:18:36 11:41:01 AM 2 6.00 0.00 0.89 0.47 0.10 92.54 12:18:36 11:41:01 AM 3 6.58 0.00 0.70 0.08 0.08 92.54 12:18:36 11:42:01 AM all 61.15 0.00 2.00 0.16 0.10 36.59 12:18:36 11:42:01 AM 0 64.99 0.00 2.12 0.07 0.10 32.71 12:18:36 11:42:01 AM 1 55.77 0.00 2.35 0.17 0.12 41.60 12:18:36 11:42:01 AM 2 60.93 0.00 1.81 0.37 0.10 36.78 12:18:36 11:42:01 AM 3 62.87 0.00 1.71 0.03 0.10 35.28 12:18:36 12:18:36 11:42:01 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 11:43:01 AM all 11.67 0.00 0.79 0.13 0.08 87.33 12:18:36 11:43:01 AM 0 11.52 0.00 0.77 0.13 0.08 87.49 12:18:36 11:43:01 AM 1 11.70 0.00 0.80 0.12 0.08 87.29 12:18:36 11:43:01 AM 2 12.01 0.00 0.79 0.07 0.08 87.05 12:18:36 11:43:01 AM 3 11.44 0.00 0.81 0.18 0.08 87.48 12:18:36 11:44:01 AM all 4.89 0.00 0.60 0.16 0.08 94.27 12:18:36 11:44:01 AM 0 4.98 0.00 0.54 0.07 0.07 94.35 12:18:36 11:44:01 AM 1 5.57 0.00 0.60 0.02 0.08 93.73 12:18:36 11:44:01 AM 2 5.18 0.00 0.59 0.15 0.08 94.00 12:18:36 11:44:01 AM 3 3.82 0.00 0.69 0.42 0.08 94.99 12:18:36 11:45:01 AM all 5.02 0.00 0.70 0.09 0.08 94.12 12:18:36 11:45:01 AM 0 5.00 0.00 0.67 0.15 0.08 94.09 12:18:36 11:45:01 AM 1 5.46 0.00 0.62 0.03 0.07 93.82 12:18:36 11:45:01 AM 2 5.23 0.00 0.84 0.08 0.08 93.76 12:18:36 11:45:01 AM 3 4.39 0.00 0.65 0.10 0.07 94.79 12:18:36 11:46:01 AM all 4.40 0.00 0.65 0.07 0.08 94.81 12:18:36 11:46:01 AM 0 4.59 0.00 0.54 0.02 0.07 94.79 12:18:36 11:46:01 AM 1 4.04 0.00 0.85 0.08 0.08 94.94 12:18:36 11:46:01 AM 2 4.35 0.00 0.60 0.07 0.08 94.90 12:18:36 11:46:01 AM 3 4.62 0.00 0.59 0.10 0.08 94.61 12:18:36 11:47:01 AM all 3.04 0.00 0.38 0.05 0.06 96.48 12:18:36 11:47:01 AM 0 2.54 0.00 0.43 0.05 0.07 96.91 12:18:36 11:47:01 AM 1 3.66 0.00 0.32 0.05 0.05 95.92 12:18:36 11:47:01 AM 2 3.13 0.00 0.44 0.03 0.07 96.33 12:18:36 11:47:01 AM 3 2.81 0.00 0.32 0.07 0.05 96.76 12:18:36 11:48:01 AM all 1.69 0.00 0.32 0.02 0.06 97.91 12:18:36 11:48:01 AM 0 1.64 0.00 0.27 0.02 0.07 98.01 12:18:36 11:48:01 AM 1 1.32 0.00 0.35 0.02 0.07 98.24 12:18:36 11:48:01 AM 2 1.81 0.00 0.37 0.02 0.07 97.74 12:18:36 11:48:01 AM 3 2.00 0.00 0.28 0.03 0.05 97.63 12:18:36 11:49:01 AM all 2.81 0.00 0.38 0.05 0.06 96.71 12:18:36 11:49:01 AM 0 2.86 0.00 0.32 0.02 0.05 96.75 12:18:36 11:49:01 AM 1 2.88 0.00 0.43 0.03 0.07 96.59 12:18:36 11:49:01 AM 2 2.82 0.00 0.37 0.07 0.07 96.68 12:18:36 11:49:01 AM 3 2.68 0.00 0.38 0.08 0.05 96.81 12:18:36 11:50:01 AM all 55.96 0.00 1.95 0.14 0.11 41.83 12:18:36 11:50:01 AM 0 61.38 0.00 1.37 0.02 0.10 37.13 12:18:36 11:50:01 AM 1 50.79 0.00 2.87 0.49 0.12 45.73 12:18:36 11:50:01 AM 2 54.90 0.00 1.79 0.03 0.10 43.17 12:18:36 11:50:01 AM 3 56.76 0.00 1.77 0.03 0.12 41.32 12:18:36 11:51:02 AM all 10.62 0.00 0.56 0.06 0.07 88.68 12:18:36 11:51:02 AM 0 9.95 0.00 0.60 0.08 0.07 89.30 12:18:36 11:51:02 AM 1 11.17 0.00 0.59 0.07 0.08 88.09 12:18:36 11:51:02 AM 2 10.81 0.00 0.50 0.05 0.07 88.57 12:18:36 11:51:02 AM 3 10.55 0.00 0.55 0.05 0.07 88.78 12:18:36 11:52:01 AM all 6.26 0.00 0.51 0.07 0.07 93.09 12:18:36 11:52:01 AM 0 5.89 0.00 0.53 0.07 0.07 93.44 12:18:36 11:52:01 AM 1 6.11 0.00 0.55 0.09 0.07 93.20 12:18:36 11:52:01 AM 2 6.87 0.00 0.44 0.05 0.07 92.57 12:18:36 11:52:01 AM 3 6.16 0.00 0.53 0.09 0.07 93.15 12:18:36 11:53:01 AM all 3.40 0.00 0.36 0.21 0.07 95.96 12:18:36 11:53:01 AM 0 3.45 0.00 0.35 0.13 0.07 96.00 12:18:36 11:53:01 AM 1 3.78 0.00 0.33 0.27 0.07 95.55 12:18:36 11:53:01 AM 2 3.08 0.00 0.45 0.35 0.08 96.03 12:18:36 11:53:01 AM 3 3.30 0.00 0.32 0.08 0.05 96.25 12:18:36 12:18:36 11:53:01 AM CPU %user %nice %system %iowait %steal %idle 12:18:36 11:54:01 AM all 3.39 0.00 0.42 0.33 0.06 95.80 12:18:36 11:54:01 AM 0 2.96 0.00 0.42 0.20 0.07 96.35 12:18:36 11:54:01 AM 1 4.14 0.00 0.35 0.25 0.05 95.21 12:18:36 11:54:01 AM 2 3.45 0.00 0.47 0.44 0.05 95.59 12:18:36 11:54:01 AM 3 3.00 0.00 0.45 0.42 0.07 96.07 12:18:36 11:55:01 AM all 2.78 0.00 0.41 0.24 0.06 96.51 12:18:36 11:55:01 AM 0 2.64 0.00 0.40 0.28 0.05 96.62 12:18:36 11:55:01 AM 1 2.71 0.00 0.49 0.13 0.07 96.60 12:18:36 11:55:01 AM 2 2.83 0.00 0.39 0.45 0.07 96.26 12:18:36 11:55:01 AM 3 2.93 0.00 0.37 0.08 0.07 96.55 12:18:36 11:56:01 AM all 5.18 0.00 0.58 0.58 0.08 93.58 12:18:36 11:56:01 AM 0 4.98 0.00 0.59 0.92 0.05 93.46 12:18:36 11:56:01 AM 1 5.15 0.00 0.62 0.91 0.07 93.25 12:18:36 11:56:01 AM 2 5.65 0.00 0.54 0.20 0.07 93.55 12:18:36 11:56:01 AM 3 4.95 0.00 0.59 0.29 0.13 94.05 12:18:36 11:57:01 AM all 36.66 0.00 1.59 0.34 0.10 61.30 12:18:36 11:57:01 AM 0 38.48 0.00 1.77 0.64 0.10 59.01 12:18:36 11:57:01 AM 1 38.40 0.00 1.27 0.05 0.10 60.18 12:18:36 11:57:01 AM 2 41.28 0.00 1.09 0.17 0.10 57.36 12:18:36 11:57:01 AM 3 28.48 0.00 2.22 0.50 0.12 68.69 12:18:36 11:58:01 AM all 46.25 0.00 1.28 0.67 0.11 51.69 12:18:36 11:58:01 AM 0 48.09 0.00 1.68 0.62 0.12 49.50 12:18:36 11:58:01 AM 1 41.54 0.00 1.46 0.28 0.12 56.60 12:18:36 11:58:01 AM 2 47.94 0.00 1.14 1.04 0.12 49.77 12:18:36 11:58:01 AM 3 47.43 0.00 0.85 0.74 0.10 50.88 12:18:36 11:59:01 AM all 10.99 0.00 0.57 0.46 0.08 87.91 12:18:36 11:59:01 AM 0 10.59 0.00 0.57 0.33 0.07 88.44 12:18:36 11:59:01 AM 1 10.85 0.00 0.64 0.40 0.08 88.02 12:18:36 11:59:01 AM 2 11.51 0.00 0.52 0.57 0.08 87.32 12:18:36 11:59:01 AM 3 11.00 0.00 0.57 0.52 0.07 87.84 12:18:36 12:00:01 PM all 4.92 0.00 0.40 0.18 0.05 94.44 12:18:36 12:00:01 PM 0 4.75 0.00 0.40 0.30 0.05 94.50 12:18:36 12:00:01 PM 1 4.37 0.00 0.40 0.22 0.05 94.96 12:18:36 12:00:01 PM 2 5.52 0.00 0.35 0.02 0.07 94.04 12:18:36 12:00:01 PM 3 5.04 0.00 0.44 0.20 0.05 94.27 12:18:36 12:01:01 PM all 3.34 0.00 0.39 0.19 0.06 96.02 12:18:36 12:01:01 PM 0 3.04 0.00 0.40 0.28 0.05 96.22 12:18:36 12:01:01 PM 1 3.36 0.00 0.43 0.08 0.07 96.05 12:18:36 12:01:01 PM 2 3.72 0.00 0.35 0.05 0.07 95.82 12:18:36 12:01:01 PM 3 3.25 0.00 0.37 0.33 0.05 96.00 12:18:36 12:02:01 PM all 5.93 0.00 0.54 0.59 0.07 92.86 12:18:36 12:02:01 PM 0 5.42 0.00 0.52 0.82 0.07 93.17 12:18:36 12:02:01 PM 1 6.43 0.00 0.57 0.47 0.07 92.47 12:18:36 12:02:01 PM 2 5.88 0.00 0.59 0.65 0.08 92.79 12:18:36 12:02:01 PM 3 5.99 0.00 0.49 0.43 0.07 93.02 12:18:36 12:03:01 PM all 2.58 0.00 0.40 0.06 0.05 96.91 12:18:36 12:03:01 PM 0 2.19 0.00 0.37 0.05 0.05 97.34 12:18:36 12:03:01 PM 1 3.41 0.00 0.35 0.00 0.05 96.19 12:18:36 12:03:01 PM 2 2.23 0.00 0.45 0.03 0.05 97.23 12:18:36 12:03:01 PM 3 2.50 0.00 0.44 0.15 0.05 96.87 12:18:36 12:04:01 PM all 3.00 0.00 0.38 0.05 0.06 96.51 12:18:36 12:04:01 PM 0 2.73 0.00 0.38 0.07 0.05 96.77 12:18:36 12:04:01 PM 1 2.61 0.00 0.45 0.07 0.07 96.80 12:18:36 12:04:01 PM 2 3.39 0.00 0.42 0.03 0.07 96.09 12:18:36 12:04:01 PM 3 3.26 0.00 0.28 0.02 0.05 96.39 12:18:36 12:18:36 12:04:01 PM CPU %user %nice %system %iowait %steal %idle 12:18:36 12:05:01 PM all 15.56 0.00 1.03 0.33 0.07 83.00 12:18:36 12:05:01 PM 0 16.27 0.00 0.77 0.40 0.07 82.50 12:18:36 12:05:01 PM 1 16.74 0.00 0.87 0.42 0.07 81.91 12:18:36 12:05:01 PM 2 16.19 0.00 1.07 0.32 0.08 82.33 12:18:36 12:05:01 PM 3 13.05 0.00 1.42 0.20 0.07 85.26 12:18:36 12:06:01 PM all 63.54 0.00 1.82 0.13 0.10 34.42 12:18:36 12:06:01 PM 0 69.09 0.00 2.36 0.38 0.10 28.07 12:18:36 12:06:01 PM 1 61.80 0.00 1.61 0.07 0.12 36.42 12:18:36 12:06:01 PM 2 63.04 0.00 1.84 0.05 0.08 34.99 12:18:36 12:06:01 PM 3 60.22 0.00 1.46 0.00 0.10 38.21 12:18:36 12:07:01 PM all 6.09 0.00 0.42 0.05 0.08 93.36 12:18:36 12:07:01 PM 0 5.68 0.00 0.40 0.07 0.07 93.78 12:18:36 12:07:01 PM 1 5.82 0.00 0.44 0.05 0.07 93.62 12:18:36 12:07:01 PM 2 6.19 0.00 0.52 0.03 0.10 93.16 12:18:36 12:07:01 PM 3 6.65 0.00 0.33 0.05 0.08 92.88 12:18:36 12:08:01 PM all 9.86 0.00 0.51 0.05 0.08 89.50 12:18:36 12:08:01 PM 0 9.64 0.00 0.48 0.05 0.07 89.76 12:18:36 12:08:01 PM 1 10.70 0.00 0.49 0.07 0.10 88.64 12:18:36 12:08:01 PM 2 10.18 0.00 0.60 0.07 0.08 89.07 12:18:36 12:08:01 PM 3 8.90 0.00 0.47 0.03 0.07 90.53 12:18:36 12:09:01 PM all 2.38 0.00 0.27 0.03 0.08 97.25 12:18:36 12:09:01 PM 0 2.21 0.00 0.27 0.02 0.08 97.42 12:18:36 12:09:01 PM 1 2.48 0.00 0.25 0.02 0.07 97.19 12:18:36 12:09:01 PM 2 2.30 0.00 0.28 0.02 0.07 97.34 12:18:36 12:09:01 PM 3 2.52 0.00 0.27 0.07 0.08 97.06 12:18:36 12:10:01 PM all 4.18 0.00 0.44 0.04 0.08 95.27 12:18:36 12:10:01 PM 0 4.02 0.00 0.40 0.03 0.05 95.50 12:18:36 12:10:01 PM 1 4.72 0.00 0.42 0.00 0.10 94.76 12:18:36 12:10:01 PM 2 3.57 0.00 0.49 0.10 0.08 95.76 12:18:36 12:10:01 PM 3 4.41 0.00 0.43 0.02 0.07 95.07 12:18:36 12:11:01 PM all 1.18 0.00 0.27 0.01 0.09 98.46 12:18:36 12:11:01 PM 0 1.04 0.00 0.27 0.02 0.10 98.58 12:18:36 12:11:01 PM 1 1.17 0.00 0.32 0.02 0.07 98.43 12:18:36 12:11:01 PM 2 1.46 0.00 0.27 0.02 0.10 98.16 12:18:36 12:11:01 PM 3 1.04 0.00 0.22 0.00 0.08 98.66 12:18:36 12:12:01 PM all 2.28 0.00 0.35 0.03 0.08 97.26 12:18:36 12:12:01 PM 0 1.81 0.00 0.37 0.02 0.07 97.74 12:18:36 12:12:01 PM 1 2.53 0.02 0.33 0.03 0.08 97.00 12:18:36 12:12:01 PM 2 2.40 0.00 0.42 0.05 0.08 97.05 12:18:36 12:12:01 PM 3 2.39 0.00 0.27 0.03 0.07 97.24 12:18:36 12:13:01 PM all 2.36 0.00 0.38 0.06 0.07 97.13 12:18:36 12:13:01 PM 0 1.96 0.00 0.38 0.08 0.07 97.51 12:18:36 12:13:01 PM 1 2.20 0.00 0.40 0.02 0.07 97.32 12:18:36 12:13:01 PM 2 2.79 0.00 0.38 0.02 0.08 96.72 12:18:36 12:13:01 PM 3 2.49 0.00 0.35 0.12 0.07 96.97 12:18:36 12:14:01 PM all 2.65 0.00 0.54 0.50 0.08 96.23 12:18:36 12:14:01 PM 0 2.71 0.00 0.35 0.20 0.07 96.67 12:18:36 12:14:01 PM 1 2.77 0.00 0.35 0.03 0.10 96.75 12:18:36 12:14:01 PM 2 2.57 0.00 0.40 0.45 0.07 96.51 12:18:36 12:14:01 PM 3 2.56 0.00 1.04 1.32 0.08 95.00 12:18:36 12:15:01 PM all 6.61 0.00 1.26 0.28 0.06 91.79 12:18:36 12:15:01 PM 0 3.74 0.00 0.65 0.30 0.05 95.25 12:18:36 12:15:01 PM 1 10.01 0.00 2.38 0.25 0.08 87.28 12:18:36 12:15:01 PM 2 3.88 0.00 0.82 0.10 0.07 95.13 12:18:36 12:15:01 PM 3 8.80 0.00 1.19 0.45 0.05 89.51 12:18:36 12:18:36 12:15:01 PM CPU %user %nice %system %iowait %steal %idle 12:18:36 12:16:01 PM all 78.53 0.00 2.38 2.00 0.11 16.98 12:18:36 12:16:01 PM 0 72.93 0.00 2.83 2.75 0.12 21.38 12:18:36 12:16:01 PM 1 91.79 0.00 2.19 0.02 0.10 5.90 12:18:36 12:16:01 PM 2 70.76 0.00 2.46 4.04 0.12 22.62 12:18:36 12:16:01 PM 3 78.62 0.00 2.02 1.19 0.12 18.05 12:18:36 12:17:01 PM all 27.25 0.00 1.34 0.77 0.09 70.55 12:18:36 12:17:01 PM 0 29.86 0.00 0.90 0.30 0.08 68.85 12:18:36 12:17:01 PM 1 30.53 0.00 2.06 0.79 0.10 66.52 12:18:36 12:17:01 PM 2 18.67 0.00 1.26 0.05 0.10 79.93 12:18:36 12:17:01 PM 3 29.93 0.00 1.15 1.94 0.07 66.91 12:18:36 12:18:01 PM all 22.95 0.00 2.40 9.05 0.08 65.53 12:18:36 12:18:01 PM 0 14.56 0.00 1.89 2.74 0.07 80.75 12:18:36 12:18:01 PM 1 36.61 0.00 3.36 16.24 0.08 43.70 12:18:36 12:18:01 PM 2 20.32 0.00 1.96 7.67 0.08 69.96 12:18:36 12:18:01 PM 3 20.31 0.00 2.37 9.53 0.07 67.71 12:18:36 Average: all 27.91 0.04 1.72 1.00 0.10 69.23 12:18:36 Average: 0 27.82 0.07 1.78 0.92 0.10 69.32 12:18:36 Average: 1 28.59 0.03 1.76 1.07 0.10 68.44 12:18:36 Average: 2 27.59 0.03 1.61 0.89 0.09 69.79 12:18:36 Average: 3 27.65 0.03 1.73 1.13 0.09 69.37 12:18:36 12:18:36 12:18:36