05:13:11 Triggered by Gerrit: https://git.opendaylight.org/gerrit/c/transportpce/+/113977 05:13:11 Running as SYSTEM 05:13:11 [EnvInject] - Loading node environment variables. 05:13:11 Building remotely on prd-ubuntu2004-docker-4c-16g-42530 (ubuntu2004-docker-4c-16g) in workspace /w/workspace/transportpce-tox-verify-transportpce-master 05:13:11 [ssh-agent] Looking for ssh-agent implementation... 05:13:12 [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) 05:13:12 $ ssh-agent 05:13:12 SSH_AUTH_SOCK=/tmp/ssh-pdjm7GacXVVa/agent.13305 05:13:12 SSH_AGENT_PID=13309 05:13:12 [ssh-agent] Started. 05:13:12 Running ssh-add (command line suppressed) 05:13:12 Identity added: /w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_15017684730756441106.key (/w/workspace/transportpce-tox-verify-transportpce-master@tmp/private_key_15017684730756441106.key) 05:13:12 [ssh-agent] Using credentials jenkins (jenkins-ssh) 05:13:12 The recommended git tool is: NONE 05:13:15 using credential jenkins-ssh 05:13:15 Wiping out workspace first. 05:13:15 Cloning the remote Git repository 05:13:15 Cloning repository git://devvexx.opendaylight.org/mirror/transportpce 05:13:15 > git init /w/workspace/transportpce-tox-verify-transportpce-master # timeout=10 05:13:15 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 05:13:15 > git --version # timeout=10 05:13:15 > git --version # 'git version 2.25.1' 05:13:15 using GIT_SSH to set credentials jenkins-ssh 05:13:15 Verifying host key using known hosts file 05:13:15 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' -> 'Security' -> 'Git Host Key Verification Configuration' and configure host key verification. 05:13:15 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce +refs/heads/*:refs/remotes/origin/* # timeout=10 05:13:18 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 05:13:18 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 05:13:19 > git config remote.origin.url git://devvexx.opendaylight.org/mirror/transportpce # timeout=10 05:13:19 Fetching upstream changes from git://devvexx.opendaylight.org/mirror/transportpce 05:13:19 using GIT_SSH to set credentials jenkins-ssh 05:13:19 Verifying host key using known hosts file 05:13:19 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' -> 'Security' -> 'Git Host Key Verification Configuration' and configure host key verification. 05:13:19 > git fetch --tags --force --progress -- git://devvexx.opendaylight.org/mirror/transportpce refs/changes/77/113977/1 # timeout=10 05:13:19 > git rev-parse d2c8c3d33559a40572256f3b09991f0b6cf327d4^{commit} # timeout=10 05:13:19 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script 05:13:19 Checking out Revision d2c8c3d33559a40572256f3b09991f0b6cf327d4 (refs/changes/77/113977/1) 05:13:19 > git config core.sparsecheckout # timeout=10 05:13:19 > git checkout -f d2c8c3d33559a40572256f3b09991f0b6cf327d4 # timeout=10 05:13:19 Commit message: "Allow the client to influence service frequency" 05:13:19 > git rev-parse FETCH_HEAD^{commit} # timeout=10 05:13:19 > git rev-list --no-walk 0c9b5d777221bf1ccb5f127589d30c4e4c77263d # timeout=10 05:13:20 > git remote # timeout=10 05:13:20 > git submodule init # timeout=10 05:13:20 > git submodule sync # timeout=10 05:13:20 > git config --get remote.origin.url # timeout=10 05:13:20 > git submodule init # timeout=10 05:13:20 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 05:13:20 ERROR: No submodules found. 05:13:23 provisioning config files... 05:13:23 copy managed file [npmrc] to file:/home/jenkins/.npmrc 05:13:23 copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf 05:13:23 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins8311201181175473470.sh 05:13:23 ---> python-tools-install.sh 05:13:23 Setup pyenv: 05:13:23 * system (set by /opt/pyenv/version) 05:13:23 * 3.8.13 (set by /opt/pyenv/version) 05:13:23 * 3.9.13 (set by /opt/pyenv/version) 05:13:23 * 3.10.13 (set by /opt/pyenv/version) 05:13:23 * 3.11.7 (set by /opt/pyenv/version) 05:13:28 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-fklR 05:13:28 lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv 05:13:31 lf-activate-venv(): INFO: Installing: lftools 05:14:01 lf-activate-venv(): INFO: Adding /tmp/venv-fklR/bin to PATH 05:14:01 Generating Requirements File 05:14:22 Python 3.11.7 05:14:22 pip 24.2 from /tmp/venv-fklR/lib/python3.11/site-packages/pip (python 3.11) 05:14:22 appdirs==1.4.4 05:14:22 argcomplete==3.5.1 05:14:22 aspy.yaml==1.3.0 05:14:22 attrs==24.2.0 05:14:22 autopage==0.5.2 05:14:22 beautifulsoup4==4.12.3 05:14:22 boto3==1.35.40 05:14:22 botocore==1.35.40 05:14:22 bs4==0.0.2 05:14:22 cachetools==5.5.0 05:14:22 certifi==2024.8.30 05:14:22 cffi==1.17.1 05:14:22 cfgv==3.4.0 05:14:22 chardet==5.2.0 05:14:22 charset-normalizer==3.4.0 05:14:22 click==8.1.7 05:14:22 cliff==4.7.0 05:14:22 cmd2==2.4.3 05:14:22 cryptography==3.3.2 05:14:22 debtcollector==3.0.0 05:14:22 decorator==5.1.1 05:14:22 defusedxml==0.7.1 05:14:22 Deprecated==1.2.14 05:14:22 distlib==0.3.9 05:14:22 dnspython==2.7.0 05:14:22 docker==4.2.2 05:14:22 dogpile.cache==1.3.3 05:14:22 durationpy==0.9 05:14:22 email_validator==2.2.0 05:14:22 filelock==3.16.1 05:14:22 future==1.0.0 05:14:22 gitdb==4.0.11 05:14:22 GitPython==3.1.43 05:14:22 google-auth==2.35.0 05:14:22 httplib2==0.22.0 05:14:22 identify==2.6.1 05:14:22 idna==3.10 05:14:22 importlib-resources==1.5.0 05:14:22 iso8601==2.1.0 05:14:22 Jinja2==3.1.4 05:14:22 jmespath==1.0.1 05:14:22 jsonpatch==1.33 05:14:22 jsonpointer==3.0.0 05:14:22 jsonschema==4.23.0 05:14:22 jsonschema-specifications==2024.10.1 05:14:22 keystoneauth1==5.8.0 05:14:22 kubernetes==31.0.0 05:14:22 lftools==0.37.10 05:14:22 lxml==5.3.0 05:14:22 MarkupSafe==3.0.1 05:14:22 msgpack==1.1.0 05:14:22 multi_key_dict==2.0.3 05:14:22 munch==4.0.0 05:14:22 netaddr==1.3.0 05:14:22 netifaces==0.11.0 05:14:22 niet==1.4.2 05:14:22 nodeenv==1.9.1 05:14:22 oauth2client==4.1.3 05:14:22 oauthlib==3.2.2 05:14:22 openstacksdk==4.0.0 05:14:22 os-client-config==2.1.0 05:14:22 os-service-types==1.7.0 05:14:22 osc-lib==3.1.0 05:14:22 oslo.config==9.6.0 05:14:22 oslo.context==5.6.0 05:14:22 oslo.i18n==6.4.0 05:14:22 oslo.log==6.1.2 05:14:22 oslo.serialization==5.5.0 05:14:22 oslo.utils==7.3.0 05:14:22 packaging==24.1 05:14:22 pbr==6.1.0 05:14:22 platformdirs==4.3.6 05:14:22 prettytable==3.11.0 05:14:22 pyasn1==0.6.1 05:14:22 pyasn1_modules==0.4.1 05:14:22 pycparser==2.22 05:14:22 pygerrit2==2.0.15 05:14:22 PyGithub==2.4.0 05:14:22 PyJWT==2.9.0 05:14:22 PyNaCl==1.5.0 05:14:22 pyparsing==2.4.7 05:14:22 pyperclip==1.9.0 05:14:22 pyrsistent==0.20.0 05:14:22 python-cinderclient==9.6.0 05:14:22 python-dateutil==2.9.0.post0 05:14:22 python-heatclient==4.0.0 05:14:22 python-jenkins==1.8.2 05:14:22 python-keystoneclient==5.5.0 05:14:22 python-magnumclient==4.7.0 05:14:22 python-openstackclient==7.1.3 05:14:22 python-swiftclient==4.6.0 05:14:22 PyYAML==6.0.2 05:14:22 referencing==0.35.1 05:14:22 requests==2.32.3 05:14:22 requests-oauthlib==2.0.0 05:14:22 requestsexceptions==1.4.0 05:14:22 rfc3986==2.0.0 05:14:22 rpds-py==0.20.0 05:14:22 rsa==4.9 05:14:22 ruamel.yaml==0.18.6 05:14:22 ruamel.yaml.clib==0.2.8 05:14:22 s3transfer==0.10.3 05:14:22 simplejson==3.19.3 05:14:22 six==1.16.0 05:14:22 smmap==5.0.1 05:14:22 soupsieve==2.6 05:14:22 stevedore==5.3.0 05:14:22 tabulate==0.9.0 05:14:22 toml==0.10.2 05:14:22 tomlkit==0.13.2 05:14:22 tqdm==4.66.5 05:14:22 typing_extensions==4.12.2 05:14:22 tzdata==2024.2 05:14:22 urllib3==1.26.20 05:14:22 virtualenv==20.26.6 05:14:22 wcwidth==0.2.13 05:14:22 websocket-client==1.8.0 05:14:22 wrapt==1.16.0 05:14:22 xdg==6.0.0 05:14:22 xmltodict==0.14.1 05:14:22 yq==3.4.3 05:14:22 [EnvInject] - Injecting environment variables from a build step. 05:14:22 [EnvInject] - Injecting as environment variables the properties content 05:14:22 PYTHON=python3 05:14:22 05:14:22 [EnvInject] - Variables injected successfully. 05:14:22 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins707949796674607315.sh 05:14:22 ---> tox-install.sh 05:14:22 + source /home/jenkins/lf-env.sh 05:14:22 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 05:14:22 ++ mktemp -d /tmp/venv-XXXX 05:14:22 + lf_venv=/tmp/venv-bKUs 05:14:22 + local venv_file=/tmp/.os_lf_venv 05:14:22 + local python=python3 05:14:22 + local options 05:14:22 + local set_path=true 05:14:22 + local install_args= 05:14:22 ++ 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 05:14:22 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 05:14:22 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 05:14:22 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 05:14:22 + true 05:14:22 + case $1 in 05:14:22 + venv_file=/tmp/.toxenv 05:14:22 + shift 2 05:14:22 + true 05:14:22 + case $1 in 05:14:22 + shift 05:14:22 + break 05:14:22 + case $python in 05:14:22 + local pkg_list= 05:14:22 + [[ -d /opt/pyenv ]] 05:14:22 + echo 'Setup pyenv:' 05:14:22 Setup pyenv: 05:14:22 + export PYENV_ROOT=/opt/pyenv 05:14:22 + PYENV_ROOT=/opt/pyenv 05:14:22 + export PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:22 + PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:22 + pyenv versions 05:14:22 system 05:14:22 3.8.13 05:14:22 3.9.13 05:14:22 3.10.13 05:14:22 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 05:14:22 + command -v pyenv 05:14:22 ++ pyenv init - --no-rehash 05:14:23 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 05:14:23 for i in ${!paths[@]}; do 05:14:23 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 05:14:23 fi; done; 05:14:23 echo "${paths[*]}"'\'')" 05:14:23 export PATH="/opt/pyenv/shims:${PATH}" 05:14:23 export PYENV_SHELL=bash 05:14:23 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 05:14:23 pyenv() { 05:14:23 local command 05:14:23 command="${1:-}" 05:14:23 if [ "$#" -gt 0 ]; then 05:14:23 shift 05:14:23 fi 05:14:23 05:14:23 case "$command" in 05:14:23 rehash|shell) 05:14:23 eval "$(pyenv "sh-$command" "$@")" 05:14:23 ;; 05:14:23 *) 05:14:23 command pyenv "$command" "$@" 05:14:23 ;; 05:14:23 esac 05:14:23 }' 05:14:23 +++ bash --norc -ec 'IFS=:; paths=($PATH); 05:14:23 for i in ${!paths[@]}; do 05:14:23 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 05:14:23 fi; done; 05:14:23 echo "${paths[*]}"' 05:14:23 ++ PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:23 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:23 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:23 ++ export PYENV_SHELL=bash 05:14:23 ++ PYENV_SHELL=bash 05:14:23 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 05:14:23 +++ complete -F _pyenv pyenv 05:14:23 ++ lf-pyver python3 05:14:23 ++ local py_version_xy=python3 05:14:23 ++ local py_version_xyz= 05:14:23 ++ pyenv versions 05:14:23 ++ local command 05:14:23 ++ command=versions 05:14:23 ++ '[' 1 -gt 0 ']' 05:14:23 ++ shift 05:14:23 ++ case "$command" in 05:14:23 ++ command pyenv versions 05:14:23 ++ pyenv versions 05:14:23 ++ awk '{ print $1 }' 05:14:23 ++ grep -E '^[0-9.]*[0-9]$' 05:14:23 ++ sed 's/^[ *]* //' 05:14:23 ++ [[ ! -s /tmp/.pyenv_versions ]] 05:14:23 +++ grep '^3' /tmp/.pyenv_versions 05:14:23 +++ sort -V 05:14:23 +++ tail -n 1 05:14:23 ++ py_version_xyz=3.11.7 05:14:23 ++ [[ -z 3.11.7 ]] 05:14:23 ++ echo 3.11.7 05:14:23 ++ return 0 05:14:23 + pyenv local 3.11.7 05:14:23 + local command 05:14:23 + command=local 05:14:23 + '[' 2 -gt 0 ']' 05:14:23 + shift 05:14:23 + case "$command" in 05:14:23 + command pyenv local 3.11.7 05:14:23 + pyenv local 3.11.7 05:14:23 + for arg in "$@" 05:14:23 + case $arg in 05:14:23 + pkg_list+='tox ' 05:14:23 + for arg in "$@" 05:14:23 + case $arg in 05:14:23 + pkg_list+='virtualenv ' 05:14:23 + for arg in "$@" 05:14:23 + case $arg in 05:14:23 + pkg_list+='urllib3~=1.26.15 ' 05:14:23 + [[ -f /tmp/.toxenv ]] 05:14:23 + [[ ! -f /tmp/.toxenv ]] 05:14:23 + [[ -n '' ]] 05:14:23 + python3 -m venv /tmp/venv-bKUs 05:14:27 + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-bKUs' 05:14:27 lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-bKUs 05:14:27 + echo /tmp/venv-bKUs 05:14:27 + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' 05:14:27 lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv 05:14:27 + /tmp/venv-bKUs/bin/python3 -m pip install --upgrade --quiet pip virtualenv 05:14:30 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 05:14:30 + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' 05:14:30 lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 05:14:30 + /tmp/venv-bKUs/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 05:14:32 + type python3 05:14:32 + true 05:14:32 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-bKUs/bin to PATH' 05:14:32 lf-activate-venv(): INFO: Adding /tmp/venv-bKUs/bin to PATH 05:14:32 + PATH=/tmp/venv-bKUs/bin:/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 + return 0 05:14:32 + python3 --version 05:14:32 Python 3.11.7 05:14:32 + python3 -m pip --version 05:14:32 pip 24.2 from /tmp/venv-bKUs/lib/python3.11/site-packages/pip (python 3.11) 05:14:32 + python3 -m pip freeze 05:14:32 cachetools==5.5.0 05:14:32 chardet==5.2.0 05:14:32 colorama==0.4.6 05:14:32 distlib==0.3.9 05:14:32 filelock==3.16.1 05:14:32 packaging==24.1 05:14:32 platformdirs==4.3.6 05:14:32 pluggy==1.5.0 05:14:32 pyproject-api==1.8.0 05:14:32 tox==4.21.2 05:14:32 urllib3==1.26.20 05:14:32 virtualenv==20.26.6 05:14:32 [transportpce-tox-verify-transportpce-master] $ /bin/sh -xe /tmp/jenkins13875388763188253725.sh 05:14:32 [EnvInject] - Injecting environment variables from a build step. 05:14:32 [EnvInject] - Injecting as environment variables the properties content 05:14:32 PARALLEL=True 05:14:32 05:14:32 [EnvInject] - Variables injected successfully. 05:14:32 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins9068794359237880920.sh 05:14:32 ---> tox-run.sh 05:14:32 + PATH=/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 + ARCHIVE_TOX_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 05:14:32 + ARCHIVE_DOC_DIR=/w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 05:14:32 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox 05:14:32 + cd /w/workspace/transportpce-tox-verify-transportpce-master/. 05:14:32 + source /home/jenkins/lf-env.sh 05:14:32 + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 05:14:32 ++ mktemp -d /tmp/venv-XXXX 05:14:32 + lf_venv=/tmp/venv-fyOG 05:14:32 + local venv_file=/tmp/.os_lf_venv 05:14:32 + local python=python3 05:14:32 + local options 05:14:32 + local set_path=true 05:14:32 + local install_args= 05:14:32 ++ 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 05:14:32 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 05:14:32 + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' 05:14:32 ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 05:14:32 + true 05:14:32 + case $1 in 05:14:32 + venv_file=/tmp/.toxenv 05:14:32 + shift 2 05:14:32 + true 05:14:32 + case $1 in 05:14:32 + shift 05:14:32 + break 05:14:32 + case $python in 05:14:32 + local pkg_list= 05:14:32 + [[ -d /opt/pyenv ]] 05:14:32 + echo 'Setup pyenv:' 05:14:32 Setup pyenv: 05:14:32 + export PYENV_ROOT=/opt/pyenv 05:14:32 + PYENV_ROOT=/opt/pyenv 05:14:32 + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 + pyenv versions 05:14:32 system 05:14:32 3.8.13 05:14:32 3.9.13 05:14:32 3.10.13 05:14:32 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 05:14:32 + command -v pyenv 05:14:32 ++ pyenv init - --no-rehash 05:14:32 + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); 05:14:32 for i in ${!paths[@]}; do 05:14:32 if [[ ${paths[i]} == "'\'''\''/opt/pyenv/shims'\'''\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; 05:14:32 fi; done; 05:14:32 echo "${paths[*]}"'\'')" 05:14:32 export PATH="/opt/pyenv/shims:${PATH}" 05:14:32 export PYENV_SHELL=bash 05:14:32 source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' 05:14:32 pyenv() { 05:14:32 local command 05:14:32 command="${1:-}" 05:14:32 if [ "$#" -gt 0 ]; then 05:14:32 shift 05:14:32 fi 05:14:32 05:14:32 case "$command" in 05:14:32 rehash|shell) 05:14:32 eval "$(pyenv "sh-$command" "$@")" 05:14:32 ;; 05:14:32 *) 05:14:32 command pyenv "$command" "$@" 05:14:32 ;; 05:14:32 esac 05:14:32 }' 05:14:32 +++ bash --norc -ec 'IFS=:; paths=($PATH); 05:14:32 for i in ${!paths[@]}; do 05:14:32 if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; 05:14:32 fi; done; 05:14:32 echo "${paths[*]}"' 05:14:32 ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:32 ++ export PYENV_SHELL=bash 05:14:32 ++ PYENV_SHELL=bash 05:14:32 ++ source /opt/pyenv/libexec/../completions/pyenv.bash 05:14:32 +++ complete -F _pyenv pyenv 05:14:32 ++ lf-pyver python3 05:14:32 ++ local py_version_xy=python3 05:14:32 ++ local py_version_xyz= 05:14:32 ++ pyenv versions 05:14:32 ++ local command 05:14:32 ++ command=versions 05:14:32 ++ '[' 1 -gt 0 ']' 05:14:32 ++ shift 05:14:32 ++ case "$command" in 05:14:32 ++ command pyenv versions 05:14:32 ++ pyenv versions 05:14:32 ++ awk '{ print $1 }' 05:14:32 ++ grep -E '^[0-9.]*[0-9]$' 05:14:32 ++ sed 's/^[ *]* //' 05:14:32 ++ [[ ! -s /tmp/.pyenv_versions ]] 05:14:32 +++ grep '^3' /tmp/.pyenv_versions 05:14:32 +++ sort -V 05:14:32 +++ tail -n 1 05:14:32 ++ py_version_xyz=3.11.7 05:14:32 ++ [[ -z 3.11.7 ]] 05:14:32 ++ echo 3.11.7 05:14:32 ++ return 0 05:14:32 + pyenv local 3.11.7 05:14:32 + local command 05:14:32 + command=local 05:14:32 + '[' 2 -gt 0 ']' 05:14:32 + shift 05:14:32 + case "$command" in 05:14:32 + command pyenv local 3.11.7 05:14:32 + pyenv local 3.11.7 05:14:32 + for arg in "$@" 05:14:32 + case $arg in 05:14:32 + pkg_list+='tox ' 05:14:32 + for arg in "$@" 05:14:32 + case $arg in 05:14:32 + pkg_list+='virtualenv ' 05:14:32 + for arg in "$@" 05:14:32 + case $arg in 05:14:32 + pkg_list+='urllib3~=1.26.15 ' 05:14:32 + [[ -f /tmp/.toxenv ]] 05:14:32 ++ cat /tmp/.toxenv 05:14:32 + lf_venv=/tmp/venv-bKUs 05:14:32 + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-bKUs from' file:/tmp/.toxenv 05:14:32 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-bKUs from file:/tmp/.toxenv 05:14:32 + /tmp/venv-bKUs/bin/python3 -m pip install --upgrade --quiet pip virtualenv 05:14:33 + [[ -z tox virtualenv urllib3~=1.26.15 ]] 05:14:33 + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' 05:14:33 lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 05:14:33 + /tmp/venv-bKUs/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 05:14:34 + type python3 05:14:34 + true 05:14:34 + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-bKUs/bin to PATH' 05:14:34 lf-activate-venv(): INFO: Adding /tmp/venv-bKUs/bin to PATH 05:14:34 + PATH=/tmp/venv-bKUs/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:34 + return 0 05:14:34 + [[ -d /opt/pyenv ]] 05:14:34 + echo '---> Setting up pyenv' 05:14:34 ---> Setting up pyenv 05:14:34 + export PYENV_ROOT=/opt/pyenv 05:14:34 + PYENV_ROOT=/opt/pyenv 05:14:34 + export PATH=/opt/pyenv/bin:/tmp/venv-bKUs/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:34 + PATH=/opt/pyenv/bin:/tmp/venv-bKUs/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin 05:14:34 ++ pwd 05:14:34 + PYTHONPATH=/w/workspace/transportpce-tox-verify-transportpce-master 05:14:34 + export PYTHONPATH 05:14:34 + export TOX_TESTENV_PASSENV=PYTHONPATH 05:14:34 + TOX_TESTENV_PASSENV=PYTHONPATH 05:14:34 + tox --version 05:14:35 4.21.2 from /tmp/venv-bKUs/lib/python3.11/site-packages/tox/__init__.py 05:14:35 + PARALLEL=True 05:14:35 + TOX_OPTIONS_LIST= 05:14:35 + [[ -n '' ]] 05:14:35 + case ${PARALLEL,,} in 05:14:35 + TOX_OPTIONS_LIST=' --parallel auto --parallel-live' 05:14:35 + tox --parallel auto --parallel-live 05:14:35 + tee -a /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tox.log 05:14:36 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 05:14:36 docs: install_deps> python -I -m pip install -r docs/requirements.txt 05:14:36 checkbashisms: freeze> python -m pip freeze --all 05:14:36 docs-linkcheck: install_deps> python -I -m pip install -r docs/requirements.txt 05:14:37 checkbashisms: pip==24.2,setuptools==75.1.0,wheel==0.44.0 05:14:37 checkbashisms: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 05:14:37 checkbashisms: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts || sudo yum install -y https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/x86_64/os/Packages/d/devscripts-checkbashisms-2.19.6-2.fc31.x86_64.rpm || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)' 05:14:37 checkbashisms: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> find . -not -path '*/\.*' -name '*.sh' -exec checkbashisms -f '{}' + 05:14:38 script ./reflectwarn.sh does not appear to have a #! interpreter line; 05:14:38 you may get strange results 05:14:38 checkbashisms: OK ✔ in 2.85 seconds 05:14:38 pre-commit: install_deps> python -I -m pip install pre-commit 05:14:41 pre-commit: freeze> python -m pip freeze --all 05:14:41 pre-commit: cfgv==3.4.0,distlib==0.3.9,filelock==3.16.1,identify==2.6.1,nodeenv==1.9.1,pip==24.2,platformdirs==4.3.6,pre_commit==4.0.1,PyYAML==6.0.2,setuptools==75.1.0,virtualenv==20.26.6,wheel==0.44.0 05:14:41 pre-commit: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./fixCIcentOS8reposMirrors.sh 05:14:41 pre-commit: commands[1] /w/workspace/transportpce-tox-verify-transportpce-master/tests> sh -c 'which cpan || sudo yum install -y perl-CPAN || (echo "cpan command not found - please install it (e.g. sudo apt-get install perl-modules | yum install perl-CPAN )" >&2 && exit 1)' 05:14:41 /usr/bin/cpan 05:14:41 pre-commit: commands[2] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run --all-files --show-diff-on-failure 05:14:41 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 05:14:41 [WARNING] hook id `perltidy` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 05:14:41 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. 05:14:42 [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. 05:14:42 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. 05:14:42 buildcontroller: freeze> python -m pip freeze --all 05:14:42 [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. 05:14:42 buildcontroller: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:14:42 buildcontroller: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_controller.sh 05:14:42 + update-java-alternatives -l 05:14:42 java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64 05:14:42 java-1.12.0-openjdk-amd64 1211 /usr/lib/jvm/java-1.12.0-openjdk-amd64 05:14:42 java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64 05:14:42 java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 05:14:42 java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64 05:14:42 + sudo update-java-alternatives -s java-1.21.0-openjdk-amd64 05:14:43 [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. 05:14:43 + sed -n ;s/.* version "\(.*\)\.\(.*\)\..*".*$/\1/p; 05:14:43 + java -version 05:14:43 [INFO] Initializing environment for https://github.com/pre-commit/mirrors-autopep8. 05:14:43 + JAVA_VER=21 05:14:43 + echo 21 05:14:43 21 05:14:43 + sed -n ;s/javac \(.*\)\.\(.*\)\..*.*$/\1/p; 05:14:43 + javac -version 05:14:43 [INFO] Initializing environment for https://github.com/perltidy/perltidy. 05:14:43 + JAVAC_VER=21 05:14:43 + echo 21 05:14:43 21 05:14:43 ok, java is 21 or newer 05:14:43 + [ 21 -ge 21 ] 05:14:43 + [ 21 -ge 21 ] 05:14:43 + echo ok, java is 21 or newer 05:14:43 + wget -nv https://dlcdn.apache.org/maven/maven-3/3.9.8/binaries/apache-maven-3.9.8-bin.tar.gz -P /tmp 05:14:44 [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. 05:14:44 [INFO] Once installed this environment will be reused. 05:14:44 [INFO] This may take a few minutes... 05:14:44 2024-10-15 05:14:44 URL:https://dlcdn.apache.org/maven/maven-3/3.9.8/binaries/apache-maven-3.9.8-bin.tar.gz [9083702/9083702] -> "/tmp/apache-maven-3.9.8-bin.tar.gz" [1] 05:14:44 + sudo mkdir -p /opt 05:14:44 + sudo tar xf /tmp/apache-maven-3.9.8-bin.tar.gz -C /opt 05:14:45 + sudo ln -s /opt/apache-maven-3.9.8 /opt/maven 05:14:45 + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn 05:14:45 + mvn --version 05:14:45 Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256) 05:14:45 Maven home: /opt/maven 05:14:45 Java version: 21.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 05:14:45 Default locale: en, platform encoding: UTF-8 05:14:45 OS name: "linux", version: "5.4.0-190-generic", arch: "amd64", family: "unix" 05:14:46 NOTE: Picked up JDK_JAVA_OPTIONS: 05:14:46 --add-opens=java.base/java.io=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.lang=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.net=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.nio=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.nio.file=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.util=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.util.jar=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.util.stream=ALL-UNNAMED 05:14:46 --add-opens=java.base/java.util.zip=ALL-UNNAMED 05:14:46 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 05:14:46 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 05:14:46 -Xlog:disable 05:14:48 [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. 05:14:48 [INFO] Once installed this environment will be reused. 05:14:48 [INFO] This may take a few minutes... 05:14:54 [INFO] Installing environment for https://github.com/pre-commit/mirrors-autopep8. 05:14:54 [INFO] Once installed this environment will be reused. 05:14:54 [INFO] This may take a few minutes... 05:14:58 [INFO] Installing environment for https://github.com/perltidy/perltidy. 05:14:58 [INFO] Once installed this environment will be reused. 05:14:58 [INFO] This may take a few minutes... 05:15:03 docs-linkcheck: freeze> python -m pip freeze --all 05:15:04 docs-linkcheck: alabaster==1.0.0,attrs==24.2.0,babel==2.16.0,blockdiag==3.0.0,certifi==2024.8.30,charset-normalizer==3.4.0,contourpy==1.3.0,cycler==0.12.1,docutils==0.21.2,fonttools==4.54.1,funcparserlib==2.0.0a0,future==1.0.0,idna==3.10,imagesize==1.4.1,Jinja2==3.1.4,jsonschema==3.2.0,kiwisolver==1.4.7,lfdocs-conf==0.9.0,MarkupSafe==3.0.1,matplotlib==3.9.2,numpy==2.1.2,nwdiag==3.0.0,packaging==24.1,pillow==10.4.0,pip==24.2,Pygments==2.18.0,pyparsing==3.2.0,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.2,requests==2.32.3,requests-file==1.5.1,seqdiag==3.0.0,setuptools==75.1.0,six==1.16.0,snowballstemmer==2.2.0,Sphinx==8.1.3,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.5,sphinx-rtd-theme==3.0.1,sphinx-tabs==3.4.7,sphinxcontrib-applehelp==2.0.0,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==2.0.0,sphinxcontrib-htmlhelp==2.1.0,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.30,sphinxcontrib-qthelp==2.0.0,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==2.0.0,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.2.3,webcolors==24.8.0,wheel==0.44.0 05:15:04 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 05:15:05 docs: freeze> python -m pip freeze --all 05:15:05 docs: alabaster==1.0.0,attrs==24.2.0,babel==2.16.0,blockdiag==3.0.0,certifi==2024.8.30,charset-normalizer==3.4.0,contourpy==1.3.0,cycler==0.12.1,docutils==0.21.2,fonttools==4.54.1,funcparserlib==2.0.0a0,future==1.0.0,idna==3.10,imagesize==1.4.1,Jinja2==3.1.4,jsonschema==3.2.0,kiwisolver==1.4.7,lfdocs-conf==0.9.0,MarkupSafe==3.0.1,matplotlib==3.9.2,numpy==2.1.2,nwdiag==3.0.0,packaging==24.1,pillow==10.4.0,pip==24.2,Pygments==2.18.0,pyparsing==3.2.0,pyrsistent==0.20.0,python-dateutil==2.9.0.post0,PyYAML==6.0.2,requests==2.32.3,requests-file==1.5.1,seqdiag==3.0.0,setuptools==75.1.0,six==1.16.0,snowballstemmer==2.2.0,Sphinx==8.1.3,sphinx-bootstrap-theme==0.8.1,sphinx-data-viewer==0.1.5,sphinx-rtd-theme==3.0.1,sphinx-tabs==3.4.7,sphinxcontrib-applehelp==2.0.0,sphinxcontrib-blockdiag==3.0.0,sphinxcontrib-devhelp==2.0.0,sphinxcontrib-htmlhelp==2.1.0,sphinxcontrib-jquery==4.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-needs==0.7.9,sphinxcontrib-nwdiag==2.0.0,sphinxcontrib-plantuml==0.30,sphinxcontrib-qthelp==2.0.0,sphinxcontrib-seqdiag==3.0.0,sphinxcontrib-serializinghtml==2.0.0,sphinxcontrib-swaggerdoc==0.1.7,urllib3==2.2.3,webcolors==24.8.0,wheel==0.44.0 05:15:05 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 05:15:07 docs: OK ✔ in 32.27 seconds 05:15:07 pylint: install_deps> python -I -m pip install 'pylint>=2.6.0' 05:15:10 trim trailing whitespace.................................................Passed 05:15:10 Tabs remover.............................................................Passed 05:15:10 autopep8.................................................................docs-linkcheck: OK ✔ in 32.6 seconds 05:15:12 pylint: freeze> python -m pip freeze --all 05:15:12 pylint: astroid==3.3.5,dill==0.3.9,isort==5.13.2,mccabe==0.7.0,pip==24.2,platformdirs==4.3.6,pylint==3.3.1,setuptools==75.1.0,tomlkit==0.13.2,wheel==0.44.0 05:15:12 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}$' '{}' + 05:15:14 Passed 05:15:15 perltidy.................................................................Passed 05:15:15 pre-commit: commands[3] /w/workspace/transportpce-tox-verify-transportpce-master/tests> pre-commit run gitlint-ci --hook-stage manual 05:15:16 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 05:15:16 [WARNING] hook id `perltidy` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. 05:15:16 [INFO] Installing environment for https://github.com/jorisroovers/gitlint. 05:15:16 [INFO] Once installed this environment will be reused. 05:15:16 [INFO] This may take a few minutes... 05:15:22 gitlint..................................................................Passed 05:15:32 05:15:32 ------------------------------------ 05:15:32 Your code has been rated at 10.00/10 05:15:32 05:16:20 pre-commit: OK ✔ in 44.58 seconds 05:16:20 pylint: OK ✔ in 26.26 seconds 05:16:20 buildcontroller: OK ✔ in 1 minute 44.15 seconds 05:16:20 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 05:16:20 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 05:16:20 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 05:16:20 sims: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 05:16:27 sims: freeze> python -m pip freeze --all 05:16:27 build_karaf_tests221: freeze> python -m pip freeze --all 05:16:27 build_karaf_tests121: freeze> python -m pip freeze --all 05:16:27 sims: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:16:27 sims: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./install_lightynode.sh 05:16:27 Using lighynode version 20.1.0.2 05:16:27 Installing lightynode device to ./lightynode/lightynode-openroadm-device directory 05:16:27 build_karaf_tests221: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:16:27 build_karaf_tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 05:16:27 NOTE: Picked up JDK_JAVA_OPTIONS: 05:16:27 --add-opens=java.base/java.io=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.net=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio.file=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.jar=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.stream=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.zip=ALL-UNNAMED 05:16:27 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 05:16:27 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 05:16:27 -Xlog:disable 05:16:27 build_karaf_tests121: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:16:27 build_karaf_tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 05:16:27 NOTE: Picked up JDK_JAVA_OPTIONS: 05:16:27 --add-opens=java.base/java.io=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.net=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.nio.file=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.jar=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.stream=ALL-UNNAMED 05:16:27 --add-opens=java.base/java.util.zip=ALL-UNNAMED 05:16:27 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 05:16:27 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 05:16:27 -Xlog:disable 05:16:31 sims: OK ✔ in 11.34 seconds 05:16:31 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 05:16:46 build_karaf_tests71: freeze> python -m pip freeze --all 05:16:47 build_karaf_tests71: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:16:47 build_karaf_tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 05:16:47 NOTE: Picked up JDK_JAVA_OPTIONS: 05:16:47 --add-opens=java.base/java.io=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.lang=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.net=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.nio=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.nio.file=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.util=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.util.jar=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.util.stream=ALL-UNNAMED 05:16:47 --add-opens=java.base/java.util.zip=ALL-UNNAMED 05:16:47 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 05:16:47 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 05:16:47 -Xlog:disable 05:17:15 build_karaf_tests221: OK ✔ in 55.15 seconds 05:17:15 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 05:17:16 build_karaf_tests121: OK ✔ in 56.85 seconds 05:17:16 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 05:17:24 build_karaf_tests71: OK ✔ in 52.87 seconds 05:17:24 build_karaf_tests_hybrid: freeze> python -m pip freeze --all 05:17:24 build_karaf_tests_hybrid: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:17:24 build_karaf_tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./build_karaf_for_tests.sh 05:17:24 NOTE: Picked up JDK_JAVA_OPTIONS: 05:17:24 --add-opens=java.base/java.io=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.lang=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.lang.invoke=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.net=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.nio=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.nio.charset=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.nio.file=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.util=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.util.jar=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.util.stream=ALL-UNNAMED 05:17:24 --add-opens=java.base/java.util.zip=ALL-UNNAMED 05:17:24 --add-opens java.base/sun.nio.ch=ALL-UNNAMED 05:17:24 --add-opens java.base/sun.nio.fs=ALL-UNNAMED 05:17:24 -Xlog:disable 05:17:25 testsPCE: freeze> python -m pip freeze --all 05:17:26 testsPCE: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,click==8.1.7,contourpy==1.3.0,cryptography==3.3.2,cycler==0.12.1,dict2xml==1.7.6,Flask==2.1.3,Flask-Injector==0.14.0,fonttools==4.54.1,gnpy4tpce==2.4.7,idna==3.10,iniconfig==2.0.0,injector==0.22.0,itsdangerous==2.2.0,Jinja2==3.1.4,kiwisolver==1.4.7,lxml==5.3.0,MarkupSafe==3.0.1,matplotlib==3.9.2,netconf-client==3.1.1,networkx==2.8.8,numpy==1.26.4,packaging==24.1,pandas==1.5.3,paramiko==3.5.0,pbr==5.11.1,pillow==10.4.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pyparsing==3.2.0,pytest==8.3.3,python-dateutil==2.9.0.post0,pytz==2024.2,requests==2.32.3,scipy==1.14.1,setuptools==50.3.2,six==1.16.0,urllib3==2.2.3,Werkzeug==2.0.3,wheel==0.44.0,xlrd==1.2.0 05:17:26 testsPCE: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh pce 05:17:26 pytest -q transportpce_tests/pce/test01_pce.py 05:17:27 tests_tapi: freeze> python -m pip freeze --all 05:17:27 tests_tapi: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:17:27 tests_tapi: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh tapi 05:17:27 using environment variables from ./karaf221.env 05:17:27 pytest -q transportpce_tests/tapi/test01_abstracted_topology.py 05:18:29 ................................... [100%] 05:19:33 20 passed in 127.20s (0:02:07) 05:19:33 pytest -q transportpce_tests/pce/test02_pce_400G.py 05:19:35 .......................... [100%] 05:20:15 9 passed in 41.00s 05:20:15 pytest -q transportpce_tests/pce/test03_gnpy.py 05:20:29 ............. [100%] 05:20:51 8 passed in 36.84s 05:20:51 pytest -q transportpce_tests/pce/test04_pce_bug_fix.py 05:20:54 ............ [100%] 05:21:27 3 passed in 35.31s 05:21:27 build_karaf_tests_hybrid: OK ✔ in 58.85 seconds 05:21:27 testsPCE: OK ✔ in 5 minutes 7.74 seconds 05:21:27 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 05:21:32 tests121: freeze> python -m pip freeze --all 05:21:33 tests121: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:21:33 tests121: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 05:21:33 using environment variables from ./karaf121.env 05:21:33 pytest -q transportpce_tests/1.2.1/test01_portmapping.py 05:24:14 .... [100%] 05:24:18 50 passed in 411.30s (0:06:51) 05:24:18 pytest -q transportpce_tests/tapi/test02_full_topology.py 05:25:04 ............................ [100%] 05:25:55 21 passed in 261.79s (0:04:21) 05:25:55 pytest -q transportpce_tests/1.2.1/test02_topo_portmapping.py 05:25:55 ....................... [100%] 05:28:50 30 passed in 271.25s (0:04:31) 05:28:50 pytest -q transportpce_tests/tapi/test03_tapi_device_change_notifications.py 05:29:24 ...... [100%] 05:29:38 6 passed in 223.09s (0:03:43) 05:29:38 pytest -q transportpce_tests/1.2.1/test03_topology.py 05:29:56 .......................................................................................... [100%] 05:39:28 70 passed in 638.31s (0:10:38) 05:39:29 tests_tapi: OK ✔ in 22 minutes 12.34 seconds 05:39:29 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 05:39:34 tests71: freeze> python -m pip freeze --all 05:39:35 tests71: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:39:35 tests71: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 7.1 05:39:35 using environment variables from ./karaf71.env 05:39:35 pytest -q transportpce_tests/7.1/test01_portmapping.py 05:40:04 .................. [100%] 05:40:17 12 passed in 42.40s 05:40:17 pytest -q transportpce_tests/7.1/test02_otn_renderer.py 05:40:19 ......................... [100%] 05:40:57 44 passed in 678.55s (0:11:18) 05:40:57 .pytest -q transportpce_tests/1.2.1/test04_renderer_service_path_nominal.py 05:40:59 ...................................................... [100%] 05:42:52 62 passed in 154.25s (0:02:34) 05:42:52 pytest -q transportpce_tests/7.1/test03_renderer_or_modes.py 05:43:22 ................................................................... [100%] 05:45:06 48 passed in 134.09s (0:02:14) 05:45:06 pytest -q transportpce_tests/7.1/test04_renderer_regen_mode.py 05:45:06 ..... [100%] 05:45:17 24 passed in 259.56s (0:04:19) 05:45:17 pytest -q transportpce_tests/1.2.1/test05_olm.py 05:45:35 ...................... [100%] 05:46:23 22 passed in 77.05s (0:01:17) 05:46:23 tests71: OK ✔ in 6 minutes 54.83 seconds 05:46:23 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 05:46:29 tests221: freeze> python -m pip freeze --all 05:46:30 tests221: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:46:30 tests221: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 05:46:30 using environment variables from ./karaf221.env 05:46:30 pytest -q transportpce_tests/2.2.1/test01_portmapping.py 05:47:06 .................................... [100%] 05:50:46 35 passed in 255.80s (0:04:15) 05:50:46 pytest -q transportpce_tests/2.2.1/test02_topo_portmapping.py 05:51:16 ...... [100%] 05:51:30 6 passed in 44.17s 05:51:30 pytest -q transportpce_tests/2.2.1/test03_topology.py 05:52:01 ....FF..FF..F....FFFF.......F...FF...FF.F..FF [100%] 05:53:47 =================================== FAILURES =================================== 05:53:47 ____________ TransportPCEtesting.test_04_getLinks_OpenroadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_04_getLinks_OpenroadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 10) 05:53:47 E AssertionError: 20 != 10 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:140: AssertionError 05:53:47 ____________ TransportPCEtesting.test_05_getNodes_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_05_getNodes_OpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 4) 05:53:47 E AssertionError: 8 != 4 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:166: AssertionError 05:53:47 _______________ TransportPCEtesting.test_08_getOpenRoadmNetwork ________________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_08_getOpenRoadmNetwork(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-network', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 nbNode = len(response['network'][0]['node']) 05:53:47 > self.assertEqual(nbNode, 2) 05:53:47 E AssertionError: 3 != 2 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:198: AssertionError 05:53:47 ____________ TransportPCEtesting.test_09_getNodes_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_09_getNodes_OpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 5) 05:53:47 E AssertionError: 9 != 5 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:216: AssertionError 05:53:47 ____________ TransportPCEtesting.test_12_getLinks_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_12_getLinks_OpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 12) 05:53:47 E AssertionError: 22 != 12 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:277: AssertionError 05:53:47 _______________ TransportPCEtesting.test_17_getOpenRoadmNetwork ________________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_17_getOpenRoadmNetwork(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-network', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 nbNode = len(response['network'][0]['node']) 05:53:47 > self.assertEqual(nbNode, 3) 05:53:47 E AssertionError: 4 != 3 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:351: AssertionError 05:53:47 __________ TransportPCEtesting.test_18_getROADMLinkOpenRoadmTopology ___________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_18_getROADMLinkOpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 20) 05:53:47 E AssertionError: 30 != 20 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:374: AssertionError 05:53:47 ______ TransportPCEtesting.test_19_getLinkOmsAttributesOpenRoadmTopology _______ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_19_getLinkOmsAttributesOpenRoadmTopology(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 20) 05:53:47 E AssertionError: 30 != 20 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:409: AssertionError 05:53:47 ____________ TransportPCEtesting.test_20_getNodes_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_20_getNodes_OpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 8) 05:53:47 E AssertionError: 12 != 8 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:429: AssertionError 05:53:47 ____________ TransportPCEtesting.test_28_verifyOppositeLinkTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_28_verifyOppositeLinkTopology(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 30) 05:53:47 E AssertionError: 40 != 30 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:575: AssertionError 05:53:47 ____________ TransportPCEtesting.test_32_getNodes_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_32_getNodes_OpenRoadmTopology(self): 05:53:47 # pylint: disable=redundant-unittest-assert 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 5) 05:53:47 E AssertionError: 9 != 5 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:637: AssertionError 05:53:47 _______________ TransportPCEtesting.test_33_getOpenRoadmNetwork ________________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_33_getOpenRoadmNetwork(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-network', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 nbNode = len(response['network'][0]['node']) 05:53:47 > self.assertEqual(nbNode, 2) 05:53:47 E AssertionError: 3 != 2 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:681: AssertionError 05:53:47 _______________ TransportPCEtesting.test_37_getOpenRoadmNetwork ________________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_37_getOpenRoadmNetwork(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-network', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 1) 05:53:47 E AssertionError: 2 != 1 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:705: AssertionError 05:53:47 ____________ TransportPCEtesting.test_38_getNodes_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_38_getNodes_OpenRoadmTopology(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['node']), 4) 05:53:47 E AssertionError: 8 != 4 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:711: AssertionError 05:53:47 ____________ TransportPCEtesting.test_40_getLinks_OpenRoadmTopology ____________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_40_getLinks_OpenRoadmTopology(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertEqual(len(response['network'][0]['ietf-network-topology:link']), 16) 05:53:47 E AssertionError: 26 != 16 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:745: AssertionError 05:53:47 _______________ TransportPCEtesting.test_43_getOpenRoadmNetwork ________________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_43_getOpenRoadmNetwork(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-network', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertNotIn('node', response['network'][0]) 05:53:47 E AssertionError: 'node' unexpectedly found in {'network-id': 'openroadm-network', 'network-types': {'org-openroadm-common-network:openroadm-common-network': {}}, 'node': [{'node-id': 'ROADMA01', 'org-openroadm-network:model': '2', 'supporting-node': [{'network-ref': 'clli-network', 'node-ref': 'NodeA'}], 'org-openroadm-network:vendor': 'vendorA', 'org-openroadm-network:ip': '127.0.0.12', 'org-openroadm-common-network:node-type': 'ROADM'}]} 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:789: AssertionError 05:53:47 ________ TransportPCEtesting.test_44_check_roadm2roadm_link_persistence ________ 05:53:47 05:53:47 self = 05:53:47 05:53:47 def test_44_check_roadm2roadm_link_persistence(self): 05:53:47 response = test_utils.get_ietf_network_request('openroadm-topology', 'config') 05:53:47 self.assertEqual(response['status_code'], requests.codes.ok) 05:53:47 > self.assertNotIn('node', response['network'][0]) 05:53:47 E AssertionError: 'node' unexpectedly found in {'network-id': 'openroadm-topology', 'network-types': {'org-openroadm-common-network:openroadm-common-network': {}}, 'ietf-network-topology:link': [{'link-id': 'ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX', 'source': {'source-node': 'ROADM-C1-DEG1', 'source-tp': 'DEG1-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-TTP-TXRX', 'dest-node': 'ROADM-A1-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'auto-spanloss': True, 'engineered-spanloss': '12.2', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX', 'source': {'source-node': 'ROADMA01-DEG2', 'source-tp': 'DEG2-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'EXPRESS-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-CTP-TXRX', 'dest-node': 'ROADMA01-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX'}, {'link-id': 'ROADMA01-SRG1-SRG1-CP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX', 'source': {'source-node': 'ROADMA01-SRG1', 'source-tp': 'SRG1-CP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ADD-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-CTP-TXRX', 'dest-node': 'ROADMA01-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-SRG1-SRG1-CP-TXRX'}, {'link-id': 'ROADM-A1-DEG1-DEG1-TTP-TXRXtoROADM-B1-DEG1-DEG1-TTP-TXRX', 'source': {'source-node': 'ROADM-A1-DEG1', 'source-tp': 'DEG1-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-TTP-TXRX', 'dest-node': 'ROADM-B1-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'spanloss-current': '12.0', 'auto-spanloss': True, 'engineered-spanloss': '12.2', 'spanloss-base': '11.4', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX', 'source': {'source-node': 'ROADMA01-DEG1', 'source-tp': 'DEG1-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'EXPRESS-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-CTP-TXRX', 'dest-node': 'ROADMA01-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX'}, {'link-id': 'ROADMA01-SRG3-SRG3-CP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX', 'source': {'source-node': 'ROADMA01-SRG3', 'source-tp': 'SRG3-CP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ADD-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-CTP-TXRX', 'dest-node': 'ROADMA01-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-SRG3-SRG3-CP-TXRX'}, {'link-id': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-SRG3-SRG3-CP-TXRX', 'source': {'source-node': 'ROADMA01-DEG1', 'source-tp': 'DEG1-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'DROP-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'SRG3-CP-TXRX', 'dest-node': 'ROADMA01-SRG3'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-SRG3-SRG3-CP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX'}, {'link-id': 'ROADM-B1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG1-DEG1-TTP-TXRX', 'source': {'source-node': 'ROADM-B1-DEG1', 'source-tp': 'DEG1-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-TTP-TXRX', 'dest-node': 'ROADM-A1-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADM-A1-DEG1-DEG1-TTP-TXRXtoROADM-B1-DEG1-DEG1-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'spanloss-current': '12.0', 'auto-spanloss': True, 'engineered-spanloss': '12.2', 'spanloss-base': '11.4', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX', 'source': {'source-node': 'ROADM-B1-DEG2', 'source-tp': 'DEG2-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-TTP-TXRX', 'dest-node': 'ROADM-C1-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADM-C1-DEG2-DEG2-TTP-TXRXtoROADM-B1-DEG2-DEG2-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'spanloss-current': '12.0', 'auto-spanloss': True, 'engineered-spanloss': '12.2', 'spanloss-base': '11.4', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADMA01-SRG3-SRG3-CP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX', 'source': {'source-node': 'ROADMA01-SRG3', 'source-tp': 'SRG3-CP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ADD-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-CTP-TXRX', 'dest-node': 'ROADMA01-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-SRG3-SRG3-CP-TXRX'}, {'link-id': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-SRG1-SRG1-CP-TXRX', 'source': {'source-node': 'ROADMA01-DEG2', 'source-tp': 'DEG2-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'DROP-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'SRG1-CP-TXRX', 'dest-node': 'ROADMA01-SRG1'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-SRG1-SRG1-CP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX'}, {'link-id': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-SRG3-SRG3-CP-TXRX', 'source': {'source-node': 'ROADMA01-DEG2', 'source-tp': 'DEG2-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'DROP-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'SRG3-CP-TXRX', 'dest-node': 'ROADMA01-SRG3'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-SRG3-SRG3-CP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX'}, {'link-id': 'ROADM-A1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG1-DEG1-TTP-TXRX', 'source': {'source-node': 'ROADM-A1-DEG2', 'source-tp': 'DEG2-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG1-TTP-TXRX', 'dest-node': 'ROADM-C1-DEG1'}, 'org-openroadm-common-network:opposite-link': 'ROADM-C1-DEG1-DEG1-TTP-TXRXtoROADM-A1-DEG2-DEG2-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'auto-spanloss': True, 'engineered-spanloss': '12.2', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADMA01-DEG1-DEG1-CTP-TXRXtoROADMA01-SRG1-SRG1-CP-TXRX', 'source': {'source-node': 'ROADMA01-DEG1', 'source-tp': 'DEG1-CTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'DROP-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'SRG1-CP-TXRX', 'dest-node': 'ROADMA01-SRG1'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-SRG1-SRG1-CP-TXRXtoROADMA01-DEG1-DEG1-CTP-TXRX'}, {'link-id': 'ROADM-C1-DEG2-DEG2-TTP-TXRXtoROADM-B1-DEG2-DEG2-TTP-TXRX', 'source': {'source-node': 'ROADM-C1-DEG2', 'source-tp': 'DEG2-TTP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ROADM-TO-ROADM', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-TTP-TXRX', 'dest-node': 'ROADM-B1-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADM-B1-DEG2-DEG2-TTP-TXRXtoROADM-C1-DEG2-DEG2-TTP-TXRX', 'org-openroadm-network-topology:OMS-attributes': {'span': {'auto-spanloss': True, 'engineered-spanloss': '12.2', 'link-concatenation': [{'SRLG-Id': 0, 'SRLG-length': '100000.0', 'pmd': '0.5', 'fiber-type': 'smf'}]}}}, {'link-id': 'ROADMA01-SRG1-SRG1-CP-TXRXtoROADMA01-DEG2-DEG2-CTP-TXRX', 'source': {'source-node': 'ROADMA01-SRG1', 'source-tp': 'SRG1-CP-TXRX'}, 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:link-type': 'ADD-LINK', 'org-openroadm-common-network:administrative-state': 'inService', 'destination': {'dest-tp': 'DEG2-CTP-TXRX', 'dest-node': 'ROADMA01-DEG2'}, 'org-openroadm-common-network:opposite-link': 'ROADMA01-DEG2-DEG2-CTP-TXRXtoROADMA01-SRG1-SRG1-CP-TXRX'}], 'node': [{'node-id': 'ROADMA01-DEG1', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:node-type': 'DEGREE', 'org-openroadm-common-network:administrative-state': 'inService', 'ietf-network-topology:termination-point': [{'tp-id': 'DEG1-CTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-CTP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'DEG1-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}], 'supporting-node': [{'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'}, {'network-ref': 'clli-network', 'node-ref': 'NodeA'}], 'org-openroadm-network-topology:degree-attributes': {'degree-number': 1, 'avail-freq-maps': [{'map-name': 'cband', 'freq-map': '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////', 'start-edge-freq': '191.325', 'freq-map-granularity': '6.25', 'effective-bits': 768}]}}, {'node-id': 'ROADMA01-DEG2', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:node-type': 'DEGREE', 'org-openroadm-common-network:administrative-state': 'inService', 'ietf-network-topology:termination-point': [{'tp-id': 'DEG2-TTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-TTP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'DEG2-CTP-TXRX', 'org-openroadm-common-network:tp-type': 'DEGREE-TXRX-CTP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}], 'supporting-node': [{'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'}, {'network-ref': 'clli-network', 'node-ref': 'NodeA'}], 'org-openroadm-network-topology:degree-attributes': {'degree-number': 2, 'avail-freq-maps': [{'map-name': 'cband', 'freq-map': '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////', 'start-edge-freq': '191.325', 'freq-map-granularity': '6.25', 'effective-bits': 768}]}}, {'node-id': 'ROADMA01-SRG3', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-network-topology:srg-attributes': {'avail-freq-maps': [{'map-name': 'cband', 'freq-map': '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////', 'start-edge-freq': '191.325', 'freq-map-granularity': '6.25', 'effective-bits': 768}]}, 'org-openroadm-common-network:node-type': 'SRG', 'org-openroadm-common-network:administrative-state': 'inService', 'ietf-network-topology:termination-point': [{'tp-id': 'SRG3-PP14-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP11-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP8-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP7-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP2-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP5-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP3-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP6-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP16-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP12-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP10-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP13-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP4-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP9-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG3-PP15-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}], 'supporting-node': [{'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'}, {'network-ref': 'clli-network', 'node-ref': 'NodeA'}]}, {'node-id': 'ROADMA01-SRG1', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-network-topology:srg-attributes': {'avail-freq-maps': [{'map-name': 'cband', 'freq-map': '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////', 'start-edge-freq': '191.325', 'freq-map-granularity': '6.25', 'effective-bits': 768}]}, 'org-openroadm-common-network:node-type': 'SRG', 'org-openroadm-common-network:administrative-state': 'inService', 'ietf-network-topology:termination-point': [{'tp-id': 'SRG1-PP10-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP9-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP16-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP3-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP6-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP13-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP4-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP1-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP7-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP12-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP11-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP15-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP8-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP14-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP5-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-PP2-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-PP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}, {'tp-id': 'SRG1-CP-TXRX', 'org-openroadm-common-network:tp-type': 'SRG-TXRX-CP', 'org-openroadm-common-network:operational-state': 'inService', 'org-openroadm-common-network:administrative-state': 'inService'}], 'supporting-node': [{'network-ref': 'openroadm-network', 'node-ref': 'ROADMA01'}, {'network-ref': 'clli-network', 'node-ref': 'NodeA'}]}]} 05:53:47 05:53:47 transportpce_tests/2.2.1/test03_topology.py:794: AssertionError 05:53:47 --------------------------- Captured stdout teardown --------------------------- 05:53:47 all processes killed 05:53:47 =========================== short test summary info ============================ 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_04_getLinks_OpenroadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_05_getNodes_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_08_getOpenRoadmNetwork 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_09_getNodes_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_12_getLinks_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_17_getOpenRoadmNetwork 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_18_getROADMLinkOpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_19_getLinkOmsAttributesOpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_20_getNodes_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_28_verifyOppositeLinkTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_32_getNodes_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_33_getOpenRoadmNetwork 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_37_getOpenRoadmNetwork 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_38_getNodes_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_40_getLinks_OpenRoadmTopology 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_43_getOpenRoadmNetwork 05:53:47 FAILED transportpce_tests/2.2.1/test03_topology.py::TransportPCEtesting::test_44_check_roadm2roadm_link_persistence 05:53:47 17 failed, 27 passed in 136.51s (0:02:16) 05:53:47 tests221: exit 1 (437.16 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 2.2.1 pid=44846 05:55:04 .FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [100%] 05:55:50 =================================== FAILURES =================================== 05:55:50 ______________ TransportOlmTesting.test_04_rdmC_device_connected _______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'PUT' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01' 05:55:50 body = '{"node": [{"node-id": "ROADMC01", "netconf-node-topology:host": "127.0.0.1", "netconf-node-topology:port": "17823", "...lis": "60000", "netconf-node-topology:max-connection-attempts": "0", "netconf-node-topology:keepalive-delay": "120"}]}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '589', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'PUT' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_04_rdmC_device_connected(self): 05:55:50 > response = test_utils.mount_device("ROADMC01", ('roadmc-full', self.NODE_VERSION)) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:64: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:344: in mount_device 05:55:50 response = put_request(url[RESTCONF_VERSION].format('{}', node), body) 05:55:50 transportpce_tests/common/test_utils.py:124: in put_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_04_rdmC_device_connected 05:55:50 _____________ TransportOlmTesting.test_05_connect_xpdrA_to_roadmA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADMA01", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-xpdr-rdm-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_05_connect_xpdrA_to_roadmA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-xpdr-rdm-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '1', 05:55:50 'rdm-node': 'ROADMA01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:68: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_05_connect_xpdrA_to_roadmA 05:55:50 _____________ TransportOlmTesting.test_06_connect_roadmA_to_xpdrA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADMA01", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-rdm-xpdr-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_06_connect_roadmA_to_xpdrA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-rdm-xpdr-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '1', 05:55:50 'rdm-node': 'ROADMA01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:75: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_06_connect_roadmA_to_xpdrA 05:55:50 _____________ TransportOlmTesting.test_07_connect_xpdrC_to_roadmC ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRC01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADMC01", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-xpdr-rdm-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_07_connect_xpdrC_to_roadmC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-xpdr-rdm-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRC01', 'xpdr-num': '1', 'network-num': '1', 05:55:50 'rdm-node': 'ROADMC01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:82: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_07_connect_xpdrC_to_roadmC 05:55:50 _____________ TransportOlmTesting.test_08_connect_roadmC_to_xpdrC ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRC01", "xpdr-num": "1", "network-num": "1", "rdm-node": "ROADMC01", "srg-num": "1", "termination-point-num": "SRG1-PP1-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-rdm-xpdr-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_08_connect_roadmC_to_xpdrC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-rdm-xpdr-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRC01', 'xpdr-num': '1', 'network-num': '1', 05:55:50 'rdm-node': 'ROADMC01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP1-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:89: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_08_connect_roadmC_to_xpdrC 05:55:50 ________________ TransportOlmTesting.test_09_create_OTS_ROADMA _________________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:create-ots-oms' 05:55:50 body = '{"input": {"node-id": "ROADMA01", "logical-connection-point": "DEG1-TTP-TXRX"}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '79', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:create-ots-oms', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:create-ots-oms' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:create-ots-oms (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_09_create_OTS_ROADMA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'create-ots-oms', 05:55:50 { 05:55:50 'node-id': 'ROADMA01', 05:55:50 'logical-connection-point': 'DEG1-TTP-TXRX' 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:96: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:create-ots-oms (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_09_create_OTS_ROADMA 05:55:50 ________________ TransportOlmTesting.test_10_create_OTS_ROADMC _________________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:create-ots-oms' 05:55:50 body = '{"input": {"node-id": "ROADMC01", "logical-connection-point": "DEG2-TTP-TXRX"}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '79', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:create-ots-oms', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:create-ots-oms' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:create-ots-oms (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_10_create_OTS_ROADMC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'create-ots-oms', 05:55:50 { 05:55:50 'node-id': 'ROADMC01', 05:55:50 'logical-connection-point': 'DEG2-TTP-TXRX' 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:105: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:create-ots-oms (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_10_create_OTS_ROADMC 05:55:50 __________________ TransportOlmTesting.test_11_get_PM_ROADMA ___________________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:get-pm' 05:55:50 body = '{"input": {"node-id": "ROADMA01", "resource-type": "interface", "granularity": "15min", "resource-identifier": {"resource-name": "OTS-DEG1-TTP-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '151', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:get-pm', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:get-pm' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:get-pm (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_11_get_PM_ROADMA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'get-pm', 05:55:50 { 05:55:50 'node-id': 'ROADMA01', 05:55:50 'resource-type': 'interface', 05:55:50 'granularity': '15min', 05:55:50 'resource-identifier': { 05:55:50 'resource-name': 'OTS-DEG1-TTP-TXRX' 05:55:50 } 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:114: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:get-pm (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_11_get_PM_ROADMA 05:55:50 __________________ TransportOlmTesting.test_12_get_PM_ROADMC ___________________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:get-pm' 05:55:50 body = '{"input": {"node-id": "ROADMC01", "resource-type": "interface", "granularity": "15min", "resource-identifier": {"resource-name": "OTS-DEG2-TTP-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '151', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:get-pm', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:get-pm' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:get-pm (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_12_get_PM_ROADMC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'get-pm', 05:55:50 { 05:55:50 'node-id': 'ROADMC01', 05:55:50 'resource-type': 'interface', 05:55:50 'granularity': '15min', 05:55:50 'resource-identifier': { 05:55:50 'resource-name': 'OTS-DEG2-TTP-TXRX' 05:55:50 } 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:137: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:get-pm (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_12_get_PM_ROADMC 05:55:50 ______ TransportOlmTesting.test_13_calculate_span_loss_base_ROADMA_ROADMC ______ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-base' 05:55:50 body = '{"input": {"src-type": "link", "link-id": "ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX"}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '102', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:calculate-spanloss-base', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-base' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-base (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_13_calculate_span_loss_base_ROADMA_ROADMC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'calculate-spanloss-base', 05:55:50 { 05:55:50 'src-type': 'link', 05:55:50 'link-id': 'ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX' 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:160: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-base (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_13_calculate_span_loss_base_ROADMA_ROADMC 05:55:50 ___________ TransportOlmTesting.test_14_calculate_span_loss_base_all ___________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-base' 05:55:50 body = '{"input": {"src-type": "all"}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '30', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:calculate-spanloss-base', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-base' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-base (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_14_calculate_span_loss_base_all(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'calculate-spanloss-base', 05:55:50 { 05:55:50 'src-type': 'all' 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:176: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-base (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_14_calculate_span_loss_base_all 05:55:50 ___________ TransportOlmTesting.test_15_get_OTS_DEG1_TTP_TXRX_ROADMA ___________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG1-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...ice/interface=OTS-DEG1-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots', query='content=config', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG1-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG1-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_15_get_OTS_DEG1_TTP_TXRX_ROADMA(self): 05:55:50 > response = test_utils.check_node_attribute2_request( 05:55:50 'ROADMA01', 'interface', 'OTS-DEG1-TTP-TXRX', 'org-openroadm-optical-transport-interfaces:ots') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:195: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:421: in check_node_attribute2_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG1-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_15_get_OTS_DEG1_TTP_TXRX_ROADMA 05:55:50 ___________ TransportOlmTesting.test_16_get_OTS_DEG2_TTP_TXRX_ROADMC ___________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...ice/interface=OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots', query='content=config', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_16_get_OTS_DEG2_TTP_TXRX_ROADMC(self): 05:55:50 > response = test_utils.check_node_attribute2_request( 05:55:50 'ROADMC01', 'interface', 'OTS-DEG2-TTP-TXRX', 'org-openroadm-optical-transport-interfaces:ots') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:206: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:421: in check_node_attribute2_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_16_get_OTS_DEG2_TTP_TXRX_ROADMC 05:55:50 _____________ TransportOlmTesting.test_17_servicePath_create_AToZ ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": "1", "modulation-format": "dp-qpsk", "operation": "create", "nodes"... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '593', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_17_servicePath_create_AToZ(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': '1', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'create', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRA01', 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 'src-tp': 'XPDR1-CLIENT1'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 'src-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'ROADMC01', 05:55:50 'dest-tp': 'SRG1-PP1-TXRX', 'src-tp': 'DEG2-TTP-TXRX'}, 05:55:50 {'node-id': 'XPDRC01', 05:55:50 'dest-tp': 'XPDR1-CLIENT1', 'src-tp': 'XPDR1-NETWORK1'}], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:213: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_17_servicePath_create_AToZ 05:55:50 _____________ TransportOlmTesting.test_18_servicePath_create_ZToA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": "1", "modulation-format": "dp-qpsk", "operation": "create", "nodes"... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '593', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_18_servicePath_create_ZToA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': '1', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'create', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRC01', 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 'src-tp': 'XPDR1-CLIENT1'}, 05:55:50 {'node-id': 'ROADMC01', 05:55:50 'dest-tp': 'DEG2-TTP-TXRX', 'src-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'src-tp': 'DEG1-TTP-TXRX', 'dest-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'XPDRA01', 05:55:50 'src-tp': 'XPDR1-NETWORK1', 'dest-tp': 'XPDR1-CLIENT1'}], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:241: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_18_servicePath_create_ZToA 05:55:50 _________ TransportOlmTesting.test_19_service_power_setup_XPDRA_XPDRC __________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:service-power-setup' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": 1, "nodes": [{"dest-tp": "XPDR1-NETWORK1", "src-tp": "XPDR1-CLIENT1... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '536', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:service-power-setup', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:service-power-setup' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-setup (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_19_service_power_setup_XPDRA_XPDRC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'service-power-setup', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': 1, 05:55:50 'nodes': [ 05:55:50 { 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 05:55:50 'src-tp': 'XPDR1-CLIENT1', 05:55:50 'node-id': 'XPDRA01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 05:55:50 'src-tp': 'SRG1-PP1-TXRX', 05:55:50 'node-id': 'ROADMA01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'SRG1-PP1-TXRX', 05:55:50 'src-tp': 'DEG2-TTP-TXRX', 05:55:50 'node-id': 'ROADMC01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'XPDR1-CLIENT1', 05:55:50 'src-tp': 'XPDR1-NETWORK1', 05:55:50 'node-id': 'XPDRC01' 05:55:50 } 05:55:50 ], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:269: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-setup (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_19_service_power_setup_XPDRA_XPDRC 05:55:50 ________ TransportOlmTesting.test_20_get_interface_XPDRA_XPDR1_NETWORK1 ________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog.../interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och', query='content=config', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_20_get_interface_XPDRA_XPDR1_NETWORK1(self): 05:55:50 > response = test_utils.check_node_attribute2_request( 05:55:50 'XPDRA01', 'interface', 'XPDR1-NETWORK1-761:768', 'org-openroadm-optical-channel-interfaces:och') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:307: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:421: in check_node_attribute2_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_20_get_interface_XPDRA_XPDR1_NETWORK1 05:55:50 ____________ TransportOlmTesting.test_21_get_roadmconnection_ROADMA ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768', query='content=nonconfig', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_21_get_roadmconnection_ROADMA(self): 05:55:50 > response = test_utils.check_node_attribute_request( 05:55:50 'ROADMA01', 'roadm-connections', 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:314: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:401: in check_node_attribute_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_21_get_roadmconnection_ROADMA 05:55:50 ____________ TransportOlmTesting.test_22_get_roadmconnection_ROADMC ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768', query='content=nonconfig', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_22_get_roadmconnection_ROADMC(self): 05:55:50 > response = test_utils.check_node_attribute_request( 05:55:50 'ROADMC01', 'roadm-connections', 'DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:321: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:401: in check_node_attribute_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_22_get_roadmconnection_ROADMC 05:55:50 _________ TransportOlmTesting.test_23_service_power_setup_XPDRC_XPDRA __________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:service-power-setup' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": 1, "nodes": [{"dest-tp": "XPDR1-NETWORK1", "src-tp": "XPDR1-CLIENT1... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '536', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:service-power-setup', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST', url = '/rests/operations/transportpce-olm:service-power-setup' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-setup (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_23_service_power_setup_XPDRC_XPDRA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'service-power-setup', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': 1, 05:55:50 'nodes': [ 05:55:50 { 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 05:55:50 'src-tp': 'XPDR1-CLIENT1', 05:55:50 'node-id': 'XPDRC01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'DEG2-TTP-TXRX', 05:55:50 'src-tp': 'SRG1-PP1-TXRX', 05:55:50 'node-id': 'ROADMC01' 05:55:50 }, 05:55:50 { 05:55:50 'src-tp': 'DEG1-TTP-TXRX', 05:55:50 'dest-tp': 'SRG1-PP1-TXRX', 05:55:50 'node-id': 'ROADMA01' 05:55:50 }, 05:55:50 { 05:55:50 'src-tp': 'XPDR1-NETWORK1', 05:55:50 'dest-tp': 'XPDR1-CLIENT1', 05:55:50 'node-id': 'XPDRA01' 05:55:50 } 05:55:50 ], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:327: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-setup (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_23_service_power_setup_XPDRC_XPDRA 05:55:50 ________ TransportOlmTesting.test_24_get_interface_XPDRC_XPDR1_NETWORK1 ________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog.../interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och', query='content=config', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_24_get_interface_XPDRC_XPDR1_NETWORK1(self): 05:55:50 > response = test_utils.check_node_attribute2_request( 05:55:50 'XPDRC01', 'interface', 'XPDR1-NETWORK1-761:768', 'org-openroadm-optical-channel-interfaces:och') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:365: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:421: in check_node_attribute2_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK1-761:768/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_24_get_interface_XPDRC_XPDR1_NETWORK1 05:55:50 ____________ TransportOlmTesting.test_25_get_roadmconnection_ROADMC ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768?content=nonconfig' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768', query='content=nonconfig', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768?content=nonconfig' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_25_get_roadmconnection_ROADMC(self): 05:55:50 > response = test_utils.check_node_attribute_request( 05:55:50 'ROADMC01', 'roadm-connections', 'SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:372: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:401: in check_node_attribute_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG2-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_25_get_roadmconnection_ROADMC 05:55:50 ________ TransportOlmTesting.test_26_service_power_turndown_XPDRA_XPDRC ________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:service-power-turndown' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": 1, "nodes": [{"dest-tp": "XPDR1-NETWORK1", "src-tp": "XPDR1-CLIENT1... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '536', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:service-power-turndown', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:service-power-turndown' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-turndown (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_26_service_power_turndown_XPDRA_XPDRC(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'service-power-turndown', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': 1, 05:55:50 'nodes': [ 05:55:50 { 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 05:55:50 'src-tp': 'XPDR1-CLIENT1', 05:55:50 'node-id': 'XPDRA01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 05:55:50 'src-tp': 'SRG1-PP1-TXRX', 05:55:50 'node-id': 'ROADMA01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'SRG1-PP1-TXRX', 05:55:50 'src-tp': 'DEG2-TTP-TXRX', 05:55:50 'node-id': 'ROADMC01' 05:55:50 }, 05:55:50 { 05:55:50 'dest-tp': 'XPDR1-CLIENT1', 05:55:50 'src-tp': 'XPDR1-NETWORK1', 05:55:50 'node-id': 'XPDRC01' 05:55:50 } 05:55:50 ], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:379: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:service-power-turndown (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_26_service_power_turndown_XPDRA_XPDRC 05:55:50 ____________ TransportOlmTesting.test_27_get_roadmconnection_ROADMA ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768', query='content=nonconfig', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_27_get_roadmconnection_ROADMA(self): 05:55:50 > response = test_utils.check_node_attribute_request( 05:55:50 'ROADMA01', 'roadm-connections', 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:417: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:401: in check_node_attribute_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_27_get_roadmconnection_ROADMA 05:55:50 ____________ TransportOlmTesting.test_28_get_roadmconnection_ROADMC ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog...:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768', query='content=nonconfig', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_28_get_roadmconnection_ROADMC(self): 05:55:50 > response = test_utils.check_node_attribute_request( 05:55:50 'ROADMC01', 'roadm-connections', 'DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:424: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:401: in check_node_attribute_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01/yang-ext:mount/org-openroadm-device:org-openroadm-device/roadm-connections=DEG2-TTP-TXRX-SRG1-PP1-TXRX-761:768?content=nonconfig (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_28_get_roadmconnection_ROADMC 05:55:50 _____________ TransportOlmTesting.test_29_servicePath_delete_AToZ ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": "1", "modulation-format": "dp-qpsk", "operation": "delete", "nodes"... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '593', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_29_servicePath_delete_AToZ(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': '1', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'delete', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRA01', 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 'src-tp': 'XPDR1-CLIENT1'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 'src-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'ROADMC01', 05:55:50 'dest-tp': 'SRG1-PP1-TXRX', 'src-tp': 'DEG2-TTP-TXRX'}, 05:55:50 {'node-id': 'XPDRC01', 05:55:50 'dest-tp': 'XPDR1-CLIENT1', 'src-tp': 'XPDR1-NETWORK1'}], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:430: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_29_servicePath_delete_AToZ 05:55:50 _____________ TransportOlmTesting.test_30_servicePath_delete_ZToA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test", "wave-number": "1", "modulation-format": "dp-qpsk", "operation": "delete", "nodes"... 40, "min-freq": 196.075, "max-freq": 196.125, "lower-spectral-slot-number": 761, "higher-spectral-slot-number": 768}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '593', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_30_servicePath_delete_ZToA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test', 05:55:50 'wave-number': '1', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'delete', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRC01', 05:55:50 'dest-tp': 'XPDR1-NETWORK1', 'src-tp': 'XPDR1-CLIENT1'}, 05:55:50 {'node-id': 'ROADMC01', 05:55:50 'dest-tp': 'DEG2-TTP-TXRX', 'src-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'src-tp': 'DEG1-TTP-TXRX', 'dest-tp': 'SRG1-PP1-TXRX'}, 05:55:50 {'node-id': 'XPDRA01', 05:55:50 'src-tp': 'XPDR1-NETWORK1', 'dest-tp': 'XPDR1-CLIENT1'}], 05:55:50 'center-freq': 196.1, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.075, 05:55:50 'max-freq': 196.125, 05:55:50 'lower-spectral-slot-number': 761, 05:55:50 'higher-spectral-slot-number': 768 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:458: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_30_servicePath_delete_ZToA 05:55:50 _____________ TransportOlmTesting.test_31_connect_xpdrA_to_roadmA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "2", "rdm-node": "ROADMA01", "srg-num": "1", "termination-point-num": "SRG1-PP2-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-xpdr-rdm-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-xpdr-rdm-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_31_connect_xpdrA_to_roadmA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-xpdr-rdm-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '2', 05:55:50 'rdm-node': 'ROADMA01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP2-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:488: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_31_connect_xpdrA_to_roadmA 05:55:50 _____________ TransportOlmTesting.test_32_connect_roadmA_to_xpdrA ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 body = '{"input": {"links-input": {"xpdr-node": "XPDRA01", "xpdr-num": "1", "network-num": "2", "rdm-node": "ROADMA01", "srg-num": "1", "termination-point-num": "SRG1-PP2-TXRX"}}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '171', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-networkutils:init-rdm-xpdr-links', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-networkutils:init-rdm-xpdr-links' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_32_connect_roadmA_to_xpdrA(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-networkutils', 'init-rdm-xpdr-links', 05:55:50 {'links-input': {'xpdr-node': 'XPDRA01', 'xpdr-num': '1', 'network-num': '2', 05:55:50 'rdm-node': 'ROADMA01', 'srg-num': '1', 'termination-point-num': 'SRG1-PP2-TXRX'}}) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:495: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_32_connect_roadmA_to_xpdrA 05:55:50 _____________ TransportOlmTesting.test_33_servicePath_create_AToZ ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test2", "wave-number": "2", "modulation-format": "dp-qpsk", "operation": "create", "nodes... 40, "min-freq": 196.025, "max-freq": 196.075, "lower-spectral-slot-number": 753, "higher-spectral-slot-number": 760}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '435', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_33_servicePath_create_AToZ(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test2', 05:55:50 'wave-number': '2', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'create', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRA01', 05:55:50 'dest-tp': 'XPDR1-NETWORK2', 'src-tp': 'XPDR1-CLIENT2'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 'src-tp': 'SRG1-PP2-TXRX'}], 05:55:50 'center-freq': 196.05, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.025, 05:55:50 'max-freq': 196.075, 05:55:50 'lower-spectral-slot-number': 753, 05:55:50 'higher-spectral-slot-number': 760 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:502: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_33_servicePath_create_AToZ 05:55:50 ________ TransportOlmTesting.test_34_get_interface_XPDRA_XPDR1_NETWORK2 ________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topolog.../interface=XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och', query='content=config', fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'GET' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och?content=config' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_34_get_interface_XPDRA_XPDR1_NETWORK2(self): 05:55:50 > response = test_utils.check_node_attribute2_request( 05:55:50 'XPDRA01', 'interface', 'XPDR1-NETWORK2-753:760', 'org-openroadm-optical-channel-interfaces:och') 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:526: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:421: in check_node_attribute2_request 05:55:50 response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2)) 05:55:50 transportpce_tests/common/test_utils.py:116: in get_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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/yang-ext:mount/org-openroadm-device:org-openroadm-device/interface=XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och?content=config (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_34_get_interface_XPDRA_XPDR1_NETWORK2 05:55:50 _____________ TransportOlmTesting.test_35_servicePath_delete_AToZ ______________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 body = '{"input": {"service-name": "test2", "wave-number": "2", "modulation-format": "dp-qpsk", "operation": "delete", "nodes... 40, "min-freq": 196.025, "max-freq": 196.075, "lower-spectral-slot-number": 753, "higher-spectral-slot-number": 760}}' 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '435', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-device-renderer:service-path', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-device-renderer:service-path' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_35_servicePath_delete_AToZ(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-device-renderer', 'service-path', 05:55:50 { 05:55:50 'service-name': 'test2', 05:55:50 'wave-number': '2', 05:55:50 'modulation-format': 'dp-qpsk', 05:55:50 'operation': 'delete', 05:55:50 'nodes': 05:55:50 [{'node-id': 'XPDRA01', 05:55:50 'dest-tp': 'XPDR1-NETWORK2', 'src-tp': 'XPDR1-CLIENT2'}, 05:55:50 {'node-id': 'ROADMA01', 05:55:50 'dest-tp': 'DEG1-TTP-TXRX', 'src-tp': 'SRG1-PP2-TXRX'}], 05:55:50 'center-freq': 196.05, 05:55:50 'nmc-width': 40, 05:55:50 'min-freq': 196.025, 05:55:50 'max-freq': 196.075, 05:55:50 'lower-spectral-slot-number': 753, 05:55:50 'higher-spectral-slot-number': 760 05:55:50 }) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:533: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:142: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-device-renderer:service-path (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_35_servicePath_delete_AToZ 05:55:50 ____________ TransportOlmTesting.test_36_xpdrA_device_disconnected _____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRA01' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_36_xpdrA_device_disconnected(self): 05:55:50 > response = test_utils.unmount_device("XPDRA01") 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:557: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:358: in unmount_device 05:55:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 05:55:50 transportpce_tests/common/test_utils.py:133: in delete_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 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')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_36_xpdrA_device_disconnected 05:55:50 ____________ TransportOlmTesting.test_37_xpdrC_device_disconnected _____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_37_xpdrC_device_disconnected(self): 05:55:50 > response = test_utils.unmount_device("XPDRC01") 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:561: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:358: in unmount_device 05:55:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 05:55:50 transportpce_tests/common/test_utils.py:133: in delete_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=XPDRC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_37_xpdrC_device_disconnected 05:55:50 ___________ TransportOlmTesting.test_38_calculate_span_loss_current ____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-current' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/operations/transportpce-olm:calculate-spanloss-current', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'POST' 05:55:50 url = '/rests/operations/transportpce-olm:calculate-spanloss-current' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-current (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_38_calculate_span_loss_current(self): 05:55:50 > response = test_utils.transportpce_api_rpc_request( 05:55:50 'transportpce-olm', 'calculate-spanloss-current', 05:55:50 None) 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:565: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:684: in transportpce_api_rpc_request 05:55:50 response = post_request(url, data) 05:55:50 transportpce_tests/common/test_utils.py:148: in post_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/operations/transportpce-olm:calculate-spanloss-current (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_38_calculate_span_loss_current 05:55:50 _____________ TransportOlmTesting.test_39_rdmA_device_disconnected _____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_39_rdmA_device_disconnected(self): 05:55:50 > response = test_utils.unmount_device("ROADMA01") 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:574: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:358: in unmount_device 05:55:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 05:55:50 transportpce_tests/common/test_utils.py:133: in delete_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMA01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_39_rdmA_device_disconnected 05:55:50 _____________ TransportOlmTesting.test_40_rdmC_device_disconnected _____________ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 > sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:199: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:85: in create_connection 05:55:50 raise err 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 address = ('localhost', 8182), timeout = 10, source_address = None 05:55:50 socket_options = [(6, 1, 1)] 05:55:50 05:55:50 def create_connection( 05:55:50 address: tuple[str, int], 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 source_address: tuple[str, int] | None = None, 05:55:50 socket_options: _TYPE_SOCKET_OPTIONS | None = None, 05:55:50 ) -> socket.socket: 05:55:50 """Connect to *address* and return the socket object. 05:55:50 05:55:50 Convenience function. Connect to *address* (a 2-tuple ``(host, 05:55:50 port)``) and return the socket object. Passing the optional 05:55:50 *timeout* parameter will set the timeout on the socket instance 05:55:50 before attempting to connect. If no *timeout* is supplied, the 05:55:50 global default timeout setting returned by :func:`socket.getdefaulttimeout` 05:55:50 is used. If *source_address* is set it must be a tuple of (host, port) 05:55:50 for the socket to bind as a source address before making the connection. 05:55:50 An host of '' or port 0 tells the OS to use the default. 05:55:50 """ 05:55:50 05:55:50 host, port = address 05:55:50 if host.startswith("["): 05:55:50 host = host.strip("[]") 05:55:50 err = None 05:55:50 05:55:50 # Using the value from allowed_gai_family() in the context of getaddrinfo lets 05:55:50 # us select whether to work with IPv4 DNS records, IPv6 records, or both. 05:55:50 # The original create_connection function always returns all records. 05:55:50 family = allowed_gai_family() 05:55:50 05:55:50 try: 05:55:50 host.encode("idna") 05:55:50 except UnicodeError: 05:55:50 raise LocationParseError(f"'{host}', label empty or too long") from None 05:55:50 05:55:50 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 05:55:50 af, socktype, proto, canonname, sa = res 05:55:50 sock = None 05:55:50 try: 05:55:50 sock = socket.socket(af, socktype, proto) 05:55:50 05:55:50 # If provided, set socket level options before connecting. 05:55:50 _set_socket_options(sock, socket_options) 05:55:50 05:55:50 if timeout is not _DEFAULT_TIMEOUT: 05:55:50 sock.settimeout(timeout) 05:55:50 if source_address: 05:55:50 sock.bind(source_address) 05:55:50 > sock.connect(sa) 05:55:50 E ConnectionRefusedError: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/connection.py:73: ConnectionRefusedError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01' 05:55:50 body = None 05:55:50 headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '0', 'Authorization': 'Basic YWRtaW46YWRtaW4='} 05:55:50 retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 redirect = False, assert_same_host = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), pool_timeout = None 05:55:50 release_conn = False, chunked = False, body_pos = None, preload_content = False 05:55:50 decode_content = False, response_kw = {} 05:55:50 parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01', query=None, fragment=None) 05:55:50 destination_scheme = None, conn = None, release_this_conn = True 05:55:50 http_tunnel_required = False, err = None, clean_exit = False 05:55:50 05:55:50 def urlopen( # type: ignore[override] 05:55:50 self, 05:55:50 method: str, 05:55:50 url: str, 05:55:50 body: _TYPE_BODY | None = None, 05:55:50 headers: typing.Mapping[str, str] | None = None, 05:55:50 retries: Retry | bool | int | None = None, 05:55:50 redirect: bool = True, 05:55:50 assert_same_host: bool = True, 05:55:50 timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 05:55:50 pool_timeout: int | None = None, 05:55:50 release_conn: bool | None = None, 05:55:50 chunked: bool = False, 05:55:50 body_pos: _TYPE_BODY_POSITION | None = None, 05:55:50 preload_content: bool = True, 05:55:50 decode_content: bool = True, 05:55:50 **response_kw: typing.Any, 05:55:50 ) -> BaseHTTPResponse: 05:55:50 """ 05:55:50 Get a connection from the pool and perform an HTTP request. This is the 05:55:50 lowest level call for making a request, so you'll need to specify all 05:55:50 the raw details. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 More commonly, it's appropriate to use a convenience method 05:55:50 such as :meth:`request`. 05:55:50 05:55:50 .. note:: 05:55:50 05:55:50 `release_conn` will only behave as expected if 05:55:50 `preload_content=False` because we want to make 05:55:50 `preload_content=False` the default behaviour someday soon without 05:55:50 breaking backwards compatibility. 05:55:50 05:55:50 :param method: 05:55:50 HTTP request method (such as GET, POST, PUT, etc.) 05:55:50 05:55:50 :param url: 05:55:50 The URL to perform the request on. 05:55:50 05:55:50 :param body: 05:55:50 Data to send in the request body, either :class:`str`, :class:`bytes`, 05:55:50 an iterable of :class:`str`/:class:`bytes`, or a file-like object. 05:55:50 05:55:50 :param headers: 05:55:50 Dictionary of custom headers to send, such as User-Agent, 05:55:50 If-None-Match, etc. If None, pool headers are used. If provided, 05:55:50 these headers completely replace any pool-specific headers. 05:55:50 05:55:50 :param retries: 05:55:50 Configure the number of retries to allow before raising a 05:55:50 :class:`~urllib3.exceptions.MaxRetryError` exception. 05:55:50 05:55:50 If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a 05:55:50 :class:`~urllib3.util.retry.Retry` object for fine-grained control 05:55:50 over different types of retries. 05:55:50 Pass an integer number to retry connection errors that many times, 05:55:50 but no other types of errors. Pass zero to never retry. 05:55:50 05:55:50 If ``False``, then retries are disabled and any exception is raised 05:55:50 immediately. Also, instead of raising a MaxRetryError on redirects, 05:55:50 the redirect response will be returned. 05:55:50 05:55:50 :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 05:55:50 05:55:50 :param redirect: 05:55:50 If True, automatically handle redirects (status codes 301, 302, 05:55:50 303, 307, 308). Each redirect counts as a retry. Disabling retries 05:55:50 will disable redirect, too. 05:55:50 05:55:50 :param assert_same_host: 05:55:50 If ``True``, will make sure that the host of the pool requests is 05:55:50 consistent else will raise HostChangedError. When ``False``, you can 05:55:50 use the pool on an HTTP proxy and request foreign hosts. 05:55:50 05:55:50 :param timeout: 05:55:50 If specified, overrides the default timeout for this one 05:55:50 request. It may be a float (in seconds) or an instance of 05:55:50 :class:`urllib3.util.Timeout`. 05:55:50 05:55:50 :param pool_timeout: 05:55:50 If set and the pool is set to block=True, then this method will 05:55:50 block for ``pool_timeout`` seconds and raise EmptyPoolError if no 05:55:50 connection is available within the time period. 05:55:50 05:55:50 :param bool preload_content: 05:55:50 If True, the response's body will be preloaded into memory. 05:55:50 05:55:50 :param bool decode_content: 05:55:50 If True, will attempt to decode the body based on the 05:55:50 'content-encoding' header. 05:55:50 05:55:50 :param release_conn: 05:55:50 If False, then the urlopen call will not release the connection 05:55:50 back into the pool once a response is received (but will release if 05:55:50 you read the entire contents of the response such as when 05:55:50 `preload_content=True`). This is useful if you're not preloading 05:55:50 the response's content immediately. You will need to call 05:55:50 ``r.release_conn()`` on the response ``r`` to return the connection 05:55:50 back into the pool. If None, it takes the value of ``preload_content`` 05:55:50 which defaults to ``True``. 05:55:50 05:55:50 :param bool chunked: 05:55:50 If True, urllib3 will send the body using chunked transfer 05:55:50 encoding. Otherwise, urllib3 will send the body using the standard 05:55:50 content-length form. Defaults to False. 05:55:50 05:55:50 :param int body_pos: 05:55:50 Position to seek to in file-like body in the event of a retry or 05:55:50 redirect. Typically this won't need to be set because urllib3 will 05:55:50 auto-populate the value when needed. 05:55:50 """ 05:55:50 parsed_url = parse_url(url) 05:55:50 destination_scheme = parsed_url.scheme 05:55:50 05:55:50 if headers is None: 05:55:50 headers = self.headers 05:55:50 05:55:50 if not isinstance(retries, Retry): 05:55:50 retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 05:55:50 05:55:50 if release_conn is None: 05:55:50 release_conn = preload_content 05:55:50 05:55:50 # Check host 05:55:50 if assert_same_host and not self.is_same_host(url): 05:55:50 raise HostChangedError(self, url, retries) 05:55:50 05:55:50 # Ensure that the URL we're connecting to is properly encoded 05:55:50 if url.startswith("/"): 05:55:50 url = to_str(_encode_target(url)) 05:55:50 else: 05:55:50 url = to_str(parsed_url.url) 05:55:50 05:55:50 conn = None 05:55:50 05:55:50 # Track whether `conn` needs to be released before 05:55:50 # returning/raising/recursing. Update this variable if necessary, and 05:55:50 # leave `release_conn` constant throughout the function. That way, if 05:55:50 # the function recurses, the original value of `release_conn` will be 05:55:50 # passed down into the recursive call, and its value will be respected. 05:55:50 # 05:55:50 # See issue #651 [1] for details. 05:55:50 # 05:55:50 # [1] 05:55:50 release_this_conn = release_conn 05:55:50 05:55:50 http_tunnel_required = connection_requires_http_tunnel( 05:55:50 self.proxy, self.proxy_config, destination_scheme 05:55:50 ) 05:55:50 05:55:50 # Merge the proxy headers. Only done when not using HTTP CONNECT. We 05:55:50 # have to copy the headers dict so we can safely change it without those 05:55:50 # changes being reflected in anyone else's copy. 05:55:50 if not http_tunnel_required: 05:55:50 headers = headers.copy() # type: ignore[attr-defined] 05:55:50 headers.update(self.proxy_headers) # type: ignore[union-attr] 05:55:50 05:55:50 # Must keep the exception bound to a separate variable or else Python 3 05:55:50 # complains about UnboundLocalError. 05:55:50 err = None 05:55:50 05:55:50 # Keep track of whether we cleanly exited the except block. This 05:55:50 # ensures we do proper cleanup in finally. 05:55:50 clean_exit = False 05:55:50 05:55:50 # Rewind body position, if needed. Record current position 05:55:50 # for future rewinds in the event of a redirect/retry. 05:55:50 body_pos = set_file_position(body, body_pos) 05:55:50 05:55:50 try: 05:55:50 # Request a connection from the queue. 05:55:50 timeout_obj = self._get_timeout(timeout) 05:55:50 conn = self._get_conn(timeout=pool_timeout) 05:55:50 05:55:50 conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 05:55:50 05:55:50 # Is this a closed/new connection that requires CONNECT tunnelling? 05:55:50 if self.proxy is not None and http_tunnel_required and conn.is_closed: 05:55:50 try: 05:55:50 self._prepare_proxy(conn) 05:55:50 except (BaseSSLError, OSError, SocketTimeout) as e: 05:55:50 self._raise_timeout( 05:55:50 err=e, url=self.proxy.url, timeout_value=conn.timeout 05:55:50 ) 05:55:50 raise 05:55:50 05:55:50 # If we're going to release the connection in ``finally:``, then 05:55:50 # the response doesn't need to know about the connection. Otherwise 05:55:50 # it will also try to release it and we'll have a double-release 05:55:50 # mess. 05:55:50 response_conn = conn if not release_conn else None 05:55:50 05:55:50 # Make the request on the HTTPConnection object 05:55:50 > response = self._make_request( 05:55:50 conn, 05:55:50 method, 05:55:50 url, 05:55:50 timeout=timeout_obj, 05:55:50 body=body, 05:55:50 headers=headers, 05:55:50 chunked=chunked, 05:55:50 retries=retries, 05:55:50 response_conn=response_conn, 05:55:50 preload_content=preload_content, 05:55:50 decode_content=decode_content, 05:55:50 **response_kw, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:789: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:495: in _make_request 05:55:50 conn.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:441: in request 05:55:50 self.endheaders() 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1289: in endheaders 05:55:50 self._send_output(message_body, encode_chunked=encode_chunked) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:1048: in _send_output 05:55:50 self.send(msg) 05:55:50 /opt/pyenv/versions/3.11.7/lib/python3.11/http/client.py:986: in send 05:55:50 self.connect() 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:279: in connect 05:55:50 self.sock = self._new_conn() 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 05:55:50 def _new_conn(self) -> socket.socket: 05:55:50 """Establish a socket connection and set nodelay settings on it. 05:55:50 05:55:50 :return: New socket connection. 05:55:50 """ 05:55:50 try: 05:55:50 sock = connection.create_connection( 05:55:50 (self._dns_host, self.port), 05:55:50 self.timeout, 05:55:50 source_address=self.source_address, 05:55:50 socket_options=self.socket_options, 05:55:50 ) 05:55:50 except socket.gaierror as e: 05:55:50 raise NameResolutionError(self.host, self, e) from e 05:55:50 except SocketTimeout as e: 05:55:50 raise ConnectTimeoutError( 05:55:50 self, 05:55:50 f"Connection to {self.host} timed out. (connect timeout={self.timeout})", 05:55:50 ) from e 05:55:50 05:55:50 except OSError as e: 05:55:50 > raise NewConnectionError( 05:55:50 self, f"Failed to establish a new connection: {e}" 05:55:50 ) from e 05:55:50 E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connection.py:214: NewConnectionError 05:55:50 05:55:50 The above exception was the direct cause of the following exception: 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 > resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:667: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/connectionpool.py:843: in urlopen 05:55:50 retries = retries.increment( 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 05:55:50 method = 'DELETE' 05:55:50 url = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01' 05:55:50 response = None 05:55:50 error = NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused') 05:55:50 _pool = 05:55:50 _stacktrace = 05:55:50 05:55:50 def increment( 05:55:50 self, 05:55:50 method: str | None = None, 05:55:50 url: str | None = None, 05:55:50 response: BaseHTTPResponse | None = None, 05:55:50 error: Exception | None = None, 05:55:50 _pool: ConnectionPool | None = None, 05:55:50 _stacktrace: TracebackType | None = None, 05:55:50 ) -> Self: 05:55:50 """Return a new Retry object with incremented retry counters. 05:55:50 05:55:50 :param response: A response object, or None, if the server did not 05:55:50 return a response. 05:55:50 :type response: :class:`~urllib3.response.BaseHTTPResponse` 05:55:50 :param Exception error: An error encountered during the request, or 05:55:50 None if the response was received successfully. 05:55:50 05:55:50 :return: A new ``Retry`` object. 05:55:50 """ 05:55:50 if self.total is False and error: 05:55:50 # Disabled, indicate to re-raise the error. 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 05:55:50 total = self.total 05:55:50 if total is not None: 05:55:50 total -= 1 05:55:50 05:55:50 connect = self.connect 05:55:50 read = self.read 05:55:50 redirect = self.redirect 05:55:50 status_count = self.status 05:55:50 other = self.other 05:55:50 cause = "unknown" 05:55:50 status = None 05:55:50 redirect_location = None 05:55:50 05:55:50 if error and self._is_connection_error(error): 05:55:50 # Connect retry? 05:55:50 if connect is False: 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif connect is not None: 05:55:50 connect -= 1 05:55:50 05:55:50 elif error and self._is_read_error(error): 05:55:50 # Read retry? 05:55:50 if read is False or method is None or not self._is_method_retryable(method): 05:55:50 raise reraise(type(error), error, _stacktrace) 05:55:50 elif read is not None: 05:55:50 read -= 1 05:55:50 05:55:50 elif error: 05:55:50 # Other retry? 05:55:50 if other is not None: 05:55:50 other -= 1 05:55:50 05:55:50 elif response and response.get_redirect_location(): 05:55:50 # Redirect retry? 05:55:50 if redirect is not None: 05:55:50 redirect -= 1 05:55:50 cause = "too many redirects" 05:55:50 response_redirect_location = response.get_redirect_location() 05:55:50 if response_redirect_location: 05:55:50 redirect_location = response_redirect_location 05:55:50 status = response.status 05:55:50 05:55:50 else: 05:55:50 # Incrementing because of a server error like a 500 in 05:55:50 # status_forcelist and the given method is in the allowed_methods 05:55:50 cause = ResponseError.GENERIC_ERROR 05:55:50 if response and response.status: 05:55:50 if status_count is not None: 05:55:50 status_count -= 1 05:55:50 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 05:55:50 status = response.status 05:55:50 05:55:50 history = self.history + ( 05:55:50 RequestHistory(method, url, error, status, redirect_location), 05:55:50 ) 05:55:50 05:55:50 new_retry = self.new( 05:55:50 total=total, 05:55:50 connect=connect, 05:55:50 read=read, 05:55:50 redirect=redirect, 05:55:50 status=status_count, 05:55:50 other=other, 05:55:50 history=history, 05:55:50 ) 05:55:50 05:55:50 if new_retry.is_exhausted(): 05:55:50 reason = error or ResponseError(cause) 05:55:50 > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 05:55:50 E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/urllib3/util/retry.py:519: MaxRetryError 05:55:50 05:55:50 During handling of the above exception, another exception occurred: 05:55:50 05:55:50 self = 05:55:50 05:55:50 def test_40_rdmC_device_disconnected(self): 05:55:50 > response = test_utils.unmount_device("ROADMC01") 05:55:50 05:55:50 transportpce_tests/1.2.1/test05_olm.py:578: 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 transportpce_tests/common/test_utils.py:358: in unmount_device 05:55:50 response = delete_request(url[RESTCONF_VERSION].format('{}', node)) 05:55:50 transportpce_tests/common/test_utils.py:133: in delete_request 05:55:50 return requests.request( 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/api.py:59: in request 05:55:50 return session.request(method=method, url=url, **kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:589: in request 05:55:50 resp = self.send(prep, **send_kwargs) 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/sessions.py:703: in send 05:55:50 r = adapter.send(request, **kwargs) 05:55:50 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 05:55:50 05:55:50 self = 05:55:50 request = , stream = False 05:55:50 timeout = Timeout(connect=10, read=10, total=None), verify = True, cert = None 05:55:50 proxies = OrderedDict() 05:55:50 05:55:50 def send( 05:55:50 self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 05:55:50 ): 05:55:50 """Sends PreparedRequest object. Returns Response object. 05:55:50 05:55:50 :param request: The :class:`PreparedRequest ` being sent. 05:55:50 :param stream: (optional) Whether to stream the request content. 05:55:50 :param timeout: (optional) How long to wait for the server to send 05:55:50 data before giving up, as a float, or a :ref:`(connect timeout, 05:55:50 read timeout) ` tuple. 05:55:50 :type timeout: float or tuple or urllib3 Timeout object 05:55:50 :param verify: (optional) Either a boolean, in which case it controls whether 05:55:50 we verify the server's TLS certificate, or a string, in which case it 05:55:50 must be a path to a CA bundle to use 05:55:50 :param cert: (optional) Any user-provided SSL certificate to be trusted. 05:55:50 :param proxies: (optional) The proxies dictionary to apply to the request. 05:55:50 :rtype: requests.Response 05:55:50 """ 05:55:50 05:55:50 try: 05:55:50 conn = self.get_connection_with_tls_context( 05:55:50 request, verify, proxies=proxies, cert=cert 05:55:50 ) 05:55:50 except LocationValueError as e: 05:55:50 raise InvalidURL(e, request=request) 05:55:50 05:55:50 self.cert_verify(conn, request.url, verify, cert) 05:55:50 url = self.request_url(request, proxies) 05:55:50 self.add_headers( 05:55:50 request, 05:55:50 stream=stream, 05:55:50 timeout=timeout, 05:55:50 verify=verify, 05:55:50 cert=cert, 05:55:50 proxies=proxies, 05:55:50 ) 05:55:50 05:55:50 chunked = not (request.body is None or "Content-Length" in request.headers) 05:55:50 05:55:50 if isinstance(timeout, tuple): 05:55:50 try: 05:55:50 connect, read = timeout 05:55:50 timeout = TimeoutSauce(connect=connect, read=read) 05:55:50 except ValueError: 05:55:50 raise ValueError( 05:55:50 f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 05:55:50 f"or a single float to set both timeouts to the same value." 05:55:50 ) 05:55:50 elif isinstance(timeout, TimeoutSauce): 05:55:50 pass 05:55:50 else: 05:55:50 timeout = TimeoutSauce(connect=timeout, read=timeout) 05:55:50 05:55:50 try: 05:55:50 resp = conn.urlopen( 05:55:50 method=request.method, 05:55:50 url=url, 05:55:50 body=request.body, 05:55:50 headers=request.headers, 05:55:50 redirect=False, 05:55:50 assert_same_host=False, 05:55:50 preload_content=False, 05:55:50 decode_content=False, 05:55:50 retries=self.max_retries, 05:55:50 timeout=timeout, 05:55:50 chunked=chunked, 05:55:50 ) 05:55:50 05:55:50 except (ProtocolError, OSError) as err: 05:55:50 raise ConnectionError(err, request=request) 05:55:50 05:55:50 except MaxRetryError as e: 05:55:50 if isinstance(e.reason, ConnectTimeoutError): 05:55:50 # TODO: Remove this in 3.0.0: see #2811 05:55:50 if not isinstance(e.reason, NewConnectionError): 05:55:50 raise ConnectTimeout(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, ResponseError): 05:55:50 raise RetryError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _ProxyError): 05:55:50 raise ProxyError(e, request=request) 05:55:50 05:55:50 if isinstance(e.reason, _SSLError): 05:55:50 # This branch is for urllib3 v1.22 and later. 05:55:50 raise SSLError(e, request=request) 05:55:50 05:55:50 > raise ConnectionError(e, request=request) 05:55:50 E requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8182): Max retries exceeded with url: /rests/data/network-topology:network-topology/topology=topology-netconf/node=ROADMC01 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) 05:55:50 05:55:50 ../.tox/tests121/lib/python3.11/site-packages/requests/adapters.py:700: ConnectionError 05:55:50 ----------------------------- Captured stdout call ----------------------------- 05:55:50 execution of test_40_rdmC_device_disconnected 05:55:50 --------------------------- Captured stdout teardown --------------------------- 05:55:50 all processes killed 05:55:50 =========================== short test summary info ============================ 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_04_rdmC_device_connected 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_05_connect_xpdrA_to_roadmA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_06_connect_roadmA_to_xpdrA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_07_connect_xpdrC_to_roadmC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_08_connect_roadmC_to_xpdrC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_09_create_OTS_ROADMA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_10_create_OTS_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_11_get_PM_ROADMA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_12_get_PM_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_13_calculate_span_loss_base_ROADMA_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_14_calculate_span_loss_base_all 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_15_get_OTS_DEG1_TTP_TXRX_ROADMA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_16_get_OTS_DEG2_TTP_TXRX_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_17_servicePath_create_AToZ 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_18_servicePath_create_ZToA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_19_service_power_setup_XPDRA_XPDRC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_20_get_interface_XPDRA_XPDR1_NETWORK1 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_21_get_roadmconnection_ROADMA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_22_get_roadmconnection_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_23_service_power_setup_XPDRC_XPDRA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_24_get_interface_XPDRC_XPDR1_NETWORK1 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_25_get_roadmconnection_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_26_service_power_turndown_XPDRA_XPDRC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_27_get_roadmconnection_ROADMA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_28_get_roadmconnection_ROADMC 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_29_servicePath_delete_AToZ 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_30_servicePath_delete_ZToA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_31_connect_xpdrA_to_roadmA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_32_connect_roadmA_to_xpdrA 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_33_servicePath_create_AToZ 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_34_get_interface_XPDRA_XPDR1_NETWORK2 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_35_servicePath_delete_AToZ 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_36_xpdrA_device_disconnected 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_37_xpdrC_device_disconnected 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_38_calculate_span_loss_current 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_39_rdmA_device_disconnected 05:55:50 FAILED transportpce_tests/1.2.1/test05_olm.py::TransportOlmTesting::test_40_rdmC_device_disconnected 05:55:50 37 failed, 3 passed in 633.30s (0:10:33) 05:55:50 tests221: FAIL ✖ in 7 minutes 23.57 seconds 05:55:50 tests121: exit 1 (2057.58 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh 1.2.1 pid=34902 05:55:50 tests121: FAIL ✖ in 34 minutes 23.34 seconds 05:55: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 05:55:56 tests_hybrid: freeze> python -m pip freeze --all 05:55:57 tests_hybrid: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 05:55:57 tests_hybrid: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/tests> ./launch_tests.sh hybrid 05:55:57 using environment variables from ./karaf121.env 05:55:57 pytest -q transportpce_tests/hybrid/test01_device_change_notifications.py 05:56:41 ................................................... [100%] 06:01:27 51 passed in 330.49s (0:05:30) 06:01:27 pytest -q transportpce_tests/hybrid/test02_B100G_end2end.py 06:02:10 ........................................................................ [ 66%] 06:06:31 ..................................... [100%] 06:08:37 109 passed in 429.94s (0:07:09) 06:08:38 pytest -q transportpce_tests/hybrid/test03_autonomous_reroute.py 06:09:24 ..................................................... [100%] 06:15:56 53 passed in 438.49s (0:07:18) 06:15:56 tests_hybrid: OK ✔ in 20 minutes 5.95 seconds 06:15:56 buildlighty: install_deps> python -I -m pip install 'setuptools>=7.0' -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/requirements.txt -r /w/workspace/transportpce-tox-verify-transportpce-master/tests/test-requirements.txt 06:16:02 buildlighty: freeze> python -m pip freeze --all 06:16:02 buildlighty: bcrypt==4.2.0,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.1,dict2xml==1.7.6,idna==3.10,iniconfig==2.0.0,lxml==5.3.0,netconf-client==3.1.1,packaging==24.1,paramiko==3.5.0,pip==24.2,pluggy==1.5.0,psutil==6.0.0,pycparser==2.22,PyNaCl==1.5.0,pytest==8.3.3,requests==2.32.3,setuptools==75.1.0,urllib3==2.2.3,wheel==0.44.0 06:16:02 buildlighty: commands[0] /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh 06:16:02 NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED 06:16:21 [ERROR] COMPILATION ERROR : 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[17,42] cannot find symbol 06:16:21 symbol: class YangModuleInfo 06:16:21 location: package org.opendaylight.yangtools.binding 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[21,30] cannot find symbol 06:16:21 symbol: class YangModuleInfo 06:16:21 location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[343,30] cannot find symbol 06:16:21 symbol: class YangModuleInfo 06:16:21 location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[350,23] cannot find symbol 06:16:21 symbol: class YangModuleInfo 06:16:21 location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project tpce: Compilation failure: Compilation failure: 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[17,42] cannot find symbol 06:16:21 [ERROR] symbol: class YangModuleInfo 06:16:21 [ERROR] location: package org.opendaylight.yangtools.binding 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[21,30] cannot find symbol 06:16:21 [ERROR] symbol: class YangModuleInfo 06:16:21 [ERROR] location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[343,30] cannot find symbol 06:16:21 [ERROR] symbol: class YangModuleInfo 06:16:21 [ERROR] location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] /w/workspace/transportpce-tox-verify-transportpce-master/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java:[350,23] cannot find symbol 06:16:21 [ERROR] symbol: class YangModuleInfo 06:16:21 [ERROR] location: class io.lighty.controllers.tpce.utils.TPCEUtils 06:16:21 [ERROR] -> [Help 1] 06:16:21 [ERROR] 06:16:21 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 06:16:21 [ERROR] Re-run Maven using the -X switch to enable full debug logging. 06:16:21 [ERROR] 06:16:21 [ERROR] For more information about the errors and possible solutions, please read the following articles: 06:16:21 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 06:16:21 unzip: cannot find or open target/tpce-bin.zip, target/tpce-bin.zip.zip or target/tpce-bin.zip.ZIP. 06:16:21 buildlighty: exit 9 (18.39 seconds) /w/workspace/transportpce-tox-verify-transportpce-master/lighty> ./build.sh pid=53173 06:16:21 buildlighty: command failed but is marked ignore outcome so handling it as success 06:16:21 buildcontroller: OK (104.15=setup[7.40]+cmd[96.75] seconds) 06:16:21 testsPCE: OK (307.74=setup[66.41]+cmd[241.33] seconds) 06:16:21 sims: OK (11.34=setup[7.69]+cmd[3.64] seconds) 06:16:21 build_karaf_tests121: OK (56.85=setup[7.99]+cmd[48.86] seconds) 06:16:21 tests121: FAIL code 1 (2063.34=setup[5.76]+cmd[2057.58] seconds) 06:16:21 build_karaf_tests221: OK (55.15=setup[7.76]+cmd[47.39] seconds) 06:16:21 tests_tapi: OK (1332.34=setup[10.77]+cmd[1321.58] seconds) 06:16:21 tests221: FAIL code 1 (443.57=setup[6.41]+cmd[437.16] seconds) 06:16:21 build_karaf_tests71: OK (52.87=setup[16.60]+cmd[36.27] seconds) 06:16:21 tests71: OK (414.83=setup[6.13]+cmd[408.70] seconds) 06:16:21 build_karaf_tests_hybrid: OK (58.85=setup[9.85]+cmd[49.00] seconds) 06:16:21 tests_hybrid: OK (1205.95=setup[6.36]+cmd[1199.59] seconds) 06:16:21 buildlighty: OK (24.62=setup[6.23]+cmd[18.39] seconds) 06:16:21 docs: OK (32.27=setup[30.07]+cmd[2.20] seconds) 06:16:21 docs-linkcheck: OK (32.60=setup[28.72]+cmd[3.89] seconds) 06:16:21 checkbashisms: OK (2.85=setup[1.95]+cmd[0.02,0.06,0.82] seconds) 06:16:21 pre-commit: OK (44.58=setup[3.26]+cmd[0.00,0.00,34.11,7.20] seconds) 06:16:21 pylint: OK (26.26=setup[4.73]+cmd[21.53] seconds) 06:16:21 evaluation failed :( (3705.88 seconds) 06:16:21 + tox_status=255 06:16:21 + echo '---> Completed tox runs' 06:16:21 ---> Completed tox runs 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/build_karaf_tests121/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=build_karaf_tests121 06:16:21 + cp -r .tox/build_karaf_tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests121 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/build_karaf_tests221/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=build_karaf_tests221 06:16:21 + cp -r .tox/build_karaf_tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests221 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/build_karaf_tests71/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=build_karaf_tests71 06:16:21 + cp -r .tox/build_karaf_tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests71 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/build_karaf_tests_hybrid/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=build_karaf_tests_hybrid 06:16:21 + cp -r .tox/build_karaf_tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/build_karaf_tests_hybrid 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/buildcontroller/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=buildcontroller 06:16:21 + cp -r .tox/buildcontroller/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildcontroller 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/buildlighty/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=buildlighty 06:16:21 + cp -r .tox/buildlighty/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/buildlighty 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/checkbashisms/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=checkbashisms 06:16:21 + cp -r .tox/checkbashisms/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/checkbashisms 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/docs-linkcheck/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=docs-linkcheck 06:16:21 + cp -r .tox/docs-linkcheck/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs-linkcheck 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/docs/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=docs 06:16:21 + cp -r .tox/docs/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/docs 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/pre-commit/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=pre-commit 06:16:21 + cp -r .tox/pre-commit/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pre-commit 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/pylint/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=pylint 06:16:21 + cp -r .tox/pylint/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/pylint 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/sims/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=sims 06:16:21 + cp -r .tox/sims/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/sims 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/tests121/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=tests121 06:16:21 + cp -r .tox/tests121/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests121 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/tests221/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=tests221 06:16:21 + cp -r .tox/tests221/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests221 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/tests71/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=tests71 06:16:21 + cp -r .tox/tests71/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests71 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/testsPCE/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=testsPCE 06:16:21 + cp -r .tox/testsPCE/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/testsPCE 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/tests_hybrid/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=tests_hybrid 06:16:21 + cp -r .tox/tests_hybrid/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_hybrid 06:16:21 + for i in .tox/*/log 06:16:21 ++ echo .tox/tests_tapi/log 06:16:21 ++ awk -F/ '{print $2}' 06:16:21 + tox_env=tests_tapi 06:16:21 + cp -r .tox/tests_tapi/log /w/workspace/transportpce-tox-verify-transportpce-master/archives/tox/tests_tapi 06:16:21 + DOC_DIR=docs/_build/html 06:16:21 + [[ -d docs/_build/html ]] 06:16:21 + echo '---> Archiving generated docs' 06:16:21 ---> Archiving generated docs 06:16:21 + mv docs/_build/html /w/workspace/transportpce-tox-verify-transportpce-master/archives/docs 06:16:21 + echo '---> tox-run.sh ends' 06:16:21 ---> tox-run.sh ends 06:16:21 + test 255 -eq 0 06:16:21 + exit 255 06:16:21 ++ '[' 1 = 1 ']' 06:16:21 ++ '[' -x /usr/bin/clear_console ']' 06:16:21 ++ /usr/bin/clear_console -q 06:16:21 Build step 'Execute shell' marked build as failure 06:16:21 $ ssh-agent -k 06:16:21 unset SSH_AUTH_SOCK; 06:16:21 unset SSH_AGENT_PID; 06:16:21 echo Agent pid 13309 killed; 06:16:21 [ssh-agent] Stopped. 06:16:21 [PostBuildScript] - [INFO] Executing post build scripts. 06:16:21 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins9759128985486432217.sh 06:16:21 ---> sysstat.sh 06:16:22 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6937789944398957227.sh 06:16:22 ---> package-listing.sh 06:16:22 ++ facter osfamily 06:16:22 ++ tr '[:upper:]' '[:lower:]' 06:16:22 + OS_FAMILY=debian 06:16:22 + workspace=/w/workspace/transportpce-tox-verify-transportpce-master 06:16:22 + START_PACKAGES=/tmp/packages_start.txt 06:16:22 + END_PACKAGES=/tmp/packages_end.txt 06:16:22 + DIFF_PACKAGES=/tmp/packages_diff.txt 06:16:22 + PACKAGES=/tmp/packages_start.txt 06:16:22 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 06:16:22 + PACKAGES=/tmp/packages_end.txt 06:16:22 + case "${OS_FAMILY}" in 06:16:22 + dpkg -l 06:16:22 + grep '^ii' 06:16:22 + '[' -f /tmp/packages_start.txt ']' 06:16:22 + '[' -f /tmp/packages_end.txt ']' 06:16:22 + diff /tmp/packages_start.txt /tmp/packages_end.txt 06:16:22 + '[' /w/workspace/transportpce-tox-verify-transportpce-master ']' 06:16:22 + mkdir -p /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 06:16:22 + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/transportpce-tox-verify-transportpce-master/archives/ 06:16:22 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins17113725079086390291.sh 06:16:22 ---> capture-instance-metadata.sh 06:16:23 Setup pyenv: 06:16:23 system 06:16:23 3.8.13 06:16:23 3.9.13 06:16:23 3.10.13 06:16:23 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:16:23 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-fklR from file:/tmp/.os_lf_venv 06:16:24 lf-activate-venv(): INFO: Installing: lftools 06:16:34 lf-activate-venv(): INFO: Adding /tmp/venv-fklR/bin to PATH 06:16:34 INFO: Running in OpenStack, capturing instance metadata 06:16:35 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins6790450604909687574.sh 06:16:35 provisioning config files... 06:16:36 Could not find credentials [logs] for transportpce-tox-verify-transportpce-master #2066 06:16:36 copy managed file [jenkins-log-archives-settings] to file:/w/workspace/transportpce-tox-verify-transportpce-master@tmp/config3245556920543772106tmp 06:16:36 Regular expression run condition: Expression=[^.*logs-s3.*], Label=[odl-logs-s3-cloudfront-index] 06:16:36 Run condition [Regular expression match] enabling perform for step [Provide Configuration files] 06:16:36 provisioning config files... 06:16:36 copy managed file [jenkins-s3-log-ship] to file:/home/jenkins/.aws/credentials 06:16:36 [EnvInject] - Injecting environment variables from a build step. 06:16:36 [EnvInject] - Injecting as environment variables the properties content 06:16:36 SERVER_ID=logs 06:16:36 06:16:36 [EnvInject] - Variables injected successfully. 06:16:36 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins3023785164528995707.sh 06:16:36 ---> create-netrc.sh 06:16:36 WARN: Log server credential not found. 06:16:36 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins10108528829823888369.sh 06:16:36 ---> python-tools-install.sh 06:16:36 Setup pyenv: 06:16:36 system 06:16:36 3.8.13 06:16:36 3.9.13 06:16:36 3.10.13 06:16:36 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:16:37 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-fklR from file:/tmp/.os_lf_venv 06:16:38 lf-activate-venv(): INFO: Installing: lftools 06:16:48 lf-activate-venv(): INFO: Adding /tmp/venv-fklR/bin to PATH 06:16:48 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins836191183652721313.sh 06:16:48 ---> sudo-logs.sh 06:16:48 Archiving 'sudo' log.. 06:16:49 [transportpce-tox-verify-transportpce-master] $ /bin/bash /tmp/jenkins9704255525777946012.sh 06:16:49 ---> job-cost.sh 06:16:49 Setup pyenv: 06:16:49 system 06:16:49 3.8.13 06:16:49 3.9.13 06:16:49 3.10.13 06:16:49 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:16:49 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-fklR from file:/tmp/.os_lf_venv 06:16:50 lf-activate-venv(): INFO: Installing: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 06:16:55 lf-activate-venv(): INFO: Adding /tmp/venv-fklR/bin to PATH 06:16:55 INFO: No Stack... 06:16:55 INFO: Retrieving Pricing Info for: v3-standard-4 06:16:55 INFO: Archiving Costs 06:16:56 [transportpce-tox-verify-transportpce-master] $ /bin/bash -l /tmp/jenkins11703994847693262175.sh 06:16:56 ---> logs-deploy.sh 06:16:56 Setup pyenv: 06:16:56 system 06:16:56 3.8.13 06:16:56 3.9.13 06:16:56 3.10.13 06:16:56 * 3.11.7 (set by /w/workspace/transportpce-tox-verify-transportpce-master/.python-version) 06:16:56 lf-activate-venv(): INFO: Reuse venv:/tmp/venv-fklR from file:/tmp/.os_lf_venv 06:16:57 lf-activate-venv(): INFO: Installing: lftools 06:17:06 lf-activate-venv(): INFO: Adding /tmp/venv-fklR/bin to PATH 06:17:06 WARNING: Nexus logging server not set 06:17:06 INFO: S3 path logs/releng/vex-yul-odl-jenkins-1/transportpce-tox-verify-transportpce-master/2066/ 06:17:06 INFO: archiving logs to S3 06:17:09 ---> uname -a: 06:17:09 Linux prd-ubuntu2004-docker-4c-16g-42530 5.4.0-190-generic #210-Ubuntu SMP Fri Jul 5 17:03:38 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 06:17:09 06:17:09 06:17:09 ---> lscpu: 06:17:09 Architecture: x86_64 06:17:09 CPU op-mode(s): 32-bit, 64-bit 06:17:09 Byte Order: Little Endian 06:17:09 Address sizes: 40 bits physical, 48 bits virtual 06:17:09 CPU(s): 4 06:17:09 On-line CPU(s) list: 0-3 06:17:09 Thread(s) per core: 1 06:17:09 Core(s) per socket: 1 06:17:09 Socket(s): 4 06:17:09 NUMA node(s): 1 06:17:09 Vendor ID: AuthenticAMD 06:17:09 CPU family: 23 06:17:09 Model: 49 06:17:09 Model name: AMD EPYC-Rome Processor 06:17:09 Stepping: 0 06:17:09 CPU MHz: 2799.998 06:17:09 BogoMIPS: 5599.99 06:17:09 Virtualization: AMD-V 06:17:09 Hypervisor vendor: KVM 06:17:09 Virtualization type: full 06:17:09 L1d cache: 128 KiB 06:17:09 L1i cache: 128 KiB 06:17:09 L2 cache: 2 MiB 06:17:09 L3 cache: 64 MiB 06:17:09 NUMA node0 CPU(s): 0-3 06:17:09 Vulnerability Gather data sampling: Not affected 06:17:09 Vulnerability Itlb multihit: Not affected 06:17:09 Vulnerability L1tf: Not affected 06:17:09 Vulnerability Mds: Not affected 06:17:09 Vulnerability Meltdown: Not affected 06:17:09 Vulnerability Mmio stale data: Not affected 06:17:09 Vulnerability Retbleed: Vulnerable 06:17:09 Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp 06:17:09 Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization 06:17:09 Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected 06:17:09 Vulnerability Srbds: Not affected 06:17:09 Vulnerability Tsx async abort: Not affected 06:17:09 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr wbnoinvd arat npt nrip_save umip rdpid arch_capabilities 06:17:09 06:17:09 06:17:09 ---> nproc: 06:17:09 4 06:17:09 06:17:09 06:17:09 ---> df -h: 06:17:09 Filesystem Size Used Avail Use% Mounted on 06:17:09 udev 7.8G 0 7.8G 0% /dev 06:17:09 tmpfs 1.6G 1.1M 1.6G 1% /run 06:17:09 /dev/vda1 78G 16G 62G 21% / 06:17:09 tmpfs 7.9G 0 7.9G 0% /dev/shm 06:17:09 tmpfs 5.0M 0 5.0M 0% /run/lock 06:17:09 tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup 06:17:09 /dev/loop0 62M 62M 0 100% /snap/core20/1405 06:17:09 /dev/loop1 44M 44M 0 100% /snap/snapd/15177 06:17:09 /dev/loop2 68M 68M 0 100% /snap/lxd/22753 06:17:09 /dev/vda15 105M 6.1M 99M 6% /boot/efi 06:17:09 tmpfs 1.6G 0 1.6G 0% /run/user/1001 06:17:09 /dev/loop3 92M 92M 0 100% /snap/lxd/29619 06:17:09 06:17:09 06:17:09 ---> free -m: 06:17:09 total used free shared buff/cache available 06:17:09 Mem: 15997 655 7112 1 8229 15002 06:17:09 Swap: 1023 0 1023 06:17:09 06:17:09 06:17:09 ---> ip addr: 06:17:09 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 06:17:09 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 06:17:09 inet 127.0.0.1/8 scope host lo 06:17:09 valid_lft forever preferred_lft forever 06:17:09 inet6 ::1/128 scope host 06:17:09 valid_lft forever preferred_lft forever 06:17:09 2: ens3: mtu 1458 qdisc mq state UP group default qlen 1000 06:17:09 link/ether fa:16:3e:0e:38:4d brd ff:ff:ff:ff:ff:ff 06:17:09 inet 10.30.170.58/23 brd 10.30.171.255 scope global dynamic ens3 06:17:09 valid_lft 82525sec preferred_lft 82525sec 06:17:09 inet6 fe80::f816:3eff:fe0e:384d/64 scope link 06:17:09 valid_lft forever preferred_lft forever 06:17:09 3: docker0: mtu 1458 qdisc noqueue state DOWN group default 06:17:09 link/ether 02:42:d6:b1:df:df brd ff:ff:ff:ff:ff:ff 06:17:09 inet 10.250.0.254/24 brd 10.250.0.255 scope global docker0 06:17:09 valid_lft forever preferred_lft forever 06:17:09 06:17:09 06:17:09 ---> sar -b -r -n DEV: 06:17:09 Linux 5.4.0-190-generic (prd-ubuntu2004-docker-4c-16g-42530) 10/15/24 _x86_64_ (4 CPU) 06:17:09 06:17:09 05:12:37 LINUX RESTART (4 CPU) 06:17:09 06:17:09 05:13:02 tps rtps wtps dtps bread/s bwrtn/s bdscd/s 06:17:09 05:14:01 340.19 151.29 188.90 0.00 11645.56 25297.36 0.00 06:17:09 05:15:01 183.11 27.74 155.36 0.00 1972.68 21438.47 0.00 06:17:09 05:16:01 144.06 15.16 128.90 0.00 835.73 49363.64 0.00 06:17:09 05:17:02 116.11 0.40 115.71 0.00 34.79 60686.04 0.00 06:17:09 05:18:01 165.26 12.57 152.68 0.00 2717.79 151688.81 0.00 06:17:09 05:19:01 169.48 3.35 166.13 0.00 308.96 23577.87 0.00 06:17:09 05:20:01 128.65 2.47 126.18 0.00 174.10 2233.76 0.00 06:17:09 05:21:01 75.10 0.20 74.90 0.00 16.40 1154.21 0.00 06:17:09 05:22:01 128.05 2.58 125.46 0.00 459.12 3391.97 0.00 06:17:09 05:23:01 63.70 0.03 63.66 0.00 0.40 7743.29 0.00 06:17:09 05:24:01 1.70 0.00 1.70 0.00 0.00 23.60 0.00 06:17:09 05:25:01 48.06 0.45 47.61 0.00 23.20 967.84 0.00 06:17:09 05:26:01 71.10 0.00 71.10 0.00 0.00 1053.82 0.00 06:17:09 05:27:01 69.71 0.02 69.69 0.00 0.13 1107.82 0.00 06:17:09 05:28:01 4.87 0.92 3.95 0.00 22.00 66.79 0.00 06:17:09 05:29:01 16.74 0.00 16.74 0.00 0.00 281.24 0.00 06:17:09 05:30:01 88.45 0.00 88.45 0.00 0.00 1356.31 0.00 06:17:09 05:31:01 50.75 0.00 50.75 0.00 0.00 745.22 0.00 06:17:09 05:32:01 2.42 0.00 2.42 0.00 0.00 43.73 0.00 06:17:09 05:33:01 3.73 0.00 3.73 0.00 0.00 70.79 0.00 06:17:09 05:34:01 1.90 0.00 1.90 0.00 0.00 33.33 0.00 06:17:09 05:35:01 2.57 0.00 2.57 0.00 0.00 34.26 0.00 06:17:09 05:36:01 1.72 0.00 1.72 0.00 0.00 24.40 0.00 06:17:09 05:37:01 1.88 0.00 1.88 0.00 0.00 30.66 0.00 06:17:09 05:38:01 2.33 0.00 2.33 0.00 0.00 32.79 0.00 06:17:09 05:39:01 1.95 0.00 1.95 0.00 0.00 26.53 0.00 06:17:09 05:40:01 114.25 0.05 114.20 0.00 0.80 3304.65 0.00 06:17:09 05:41:01 107.30 0.00 107.30 0.00 0.00 8500.18 0.00 06:17:09 05:42:01 58.21 0.00 58.21 0.00 0.00 845.85 0.00 06:17:09 05:43:01 16.38 0.00 16.38 0.00 0.00 269.02 0.00 06:17:09 05:44:01 69.71 0.00 69.71 0.00 0.00 998.10 0.00 06:17:09 05:45:01 3.53 0.00 3.53 0.00 0.00 71.85 0.00 06:17:09 05:46:01 101.68 0.02 101.67 0.00 0.27 1535.08 0.00 06:17:09 05:47:01 37.39 0.02 37.37 0.00 0.13 1347.82 0.00 06:17:09 05:48:01 53.21 0.00 53.21 0.00 0.00 2163.24 0.00 06:17:09 05:49:01 2.80 0.00 2.80 0.00 0.00 34.13 0.00 06:17:09 05:50:01 2.38 0.00 2.38 0.00 0.00 143.44 0.00 06:17:09 05:51:01 25.81 0.00 25.81 0.00 0.00 397.40 0.00 06:17:09 05:52:01 86.67 0.00 86.67 0.00 0.00 1266.86 0.00 06:17:09 05:53:01 55.34 0.00 55.34 0.00 0.00 789.34 0.00 06:17:09 05:54:01 1.75 0.00 1.75 0.00 0.00 34.79 0.00 06:17:09 05:55:01 2.57 0.00 2.57 0.00 0.00 35.46 0.00 06:17:09 05:56:01 7.62 0.05 7.57 0.00 1.87 383.27 0.00 06:17:09 05:57:01 108.00 0.00 108.00 0.00 0.00 9699.85 0.00 06:17:09 05:58:01 4.23 0.00 4.23 0.00 0.00 166.61 0.00 06:17:09 05:59:01 1.63 0.00 1.63 0.00 0.00 26.26 0.00 06:17:09 06:00:01 1.73 0.00 1.73 0.00 0.00 20.93 0.00 06:17:09 06:01:01 1.53 0.00 1.53 0.00 0.00 20.26 0.00 06:17:09 06:02:01 17.50 0.00 17.50 0.00 0.00 504.32 0.00 06:17:09 06:03:01 50.27 0.00 50.27 0.00 0.00 722.68 0.00 06:17:09 06:04:01 1.80 0.00 1.80 0.00 0.00 31.46 0.00 06:17:09 06:05:01 2.55 0.00 2.55 0.00 0.00 47.06 0.00 06:17:09 06:06:01 1.60 0.00 1.60 0.00 0.00 28.13 0.00 06:17:09 06:07:01 1.70 0.00 1.70 0.00 0.00 29.86 0.00 06:17:09 06:08:01 2.45 0.00 2.45 0.00 0.00 56.52 0.00 06:17:09 06:09:01 26.20 0.00 26.20 0.00 0.00 421.53 0.00 06:17:09 06:10:02 62.41 0.00 62.41 0.00 0.00 900.25 0.00 06:17:09 06:11:01 1.90 0.00 1.90 0.00 0.00 241.59 0.00 06:17:09 06:12:01 2.35 0.00 2.35 0.00 0.00 74.12 0.00 06:17:09 06:13:01 1.83 0.00 1.83 0.00 0.00 48.13 0.00 06:17:09 06:14:01 2.57 0.00 2.57 0.00 0.00 39.73 0.00 06:17:09 06:15:01 2.20 0.00 2.20 0.00 0.00 27.86 0.00 06:17:09 06:16:01 8.98 0.00 8.98 0.00 0.00 735.21 0.00 06:17:09 06:17:01 50.91 12.28 38.63 0.00 422.46 6898.18 0.00 06:17:09 Average: 46.55 3.55 43.00 0.00 287.90 6151.05 0.00 06:17:09 06:17:09 05:13:02 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 06:17:09 05:14:01 13459020 15484536 497684 3.04 68768 2154268 1243336 7.13 750400 1898760 153156 06:17:09 05:15:01 11103816 14687548 1271256 7.76 121572 3553492 2113804 12.13 1796980 3076280 1176840 06:17:09 05:16:01 9018412 13355620 2602252 15.89 152316 4223552 3246612 18.63 3155020 3748072 421436 06:17:09 05:17:02 6029868 13007124 2948288 18.00 189328 6717688 3777816 21.67 4013236 5762936 1256500 06:17:09 05:18:01 3813668 12988756 2958264 18.06 218620 8791864 3995712 22.92 4922204 6965016 68912 06:17:09 05:19:01 1830840 11133368 4810948 29.37 226252 8907560 6497528 37.28 7001972 6854160 1820 06:17:09 05:20:01 172528 8843244 7099512 43.34 228836 8285708 8123208 46.60 9170900 6344812 0 06:17:09 05:21:01 968400 9545160 6397700 39.05 231772 8189524 7394500 42.42 8473128 6251096 840 06:17:09 05:22:01 166568 7605172 8336952 50.89 240188 7058236 9607856 55.12 10345424 5188800 204948 06:17:09 05:23:01 165292 7402160 8539772 52.13 242416 6857624 9675140 55.51 10537372 4999488 176 06:17:09 05:24:01 165184 7402132 8539852 52.13 242444 6857632 9675140 55.51 10537884 4999428 104 06:17:09 05:25:01 4181876 11421256 4522880 27.61 243460 6858832 5870864 33.68 6543656 4991108 656 06:17:09 05:26:01 3974468 11216016 4727472 28.86 245212 6859148 5616012 32.22 6764920 4976844 672 06:17:09 05:27:01 2210228 9454248 6488508 39.61 246900 6859844 7444112 42.71 8531604 4968464 136 06:17:09 05:28:01 2189268 9434372 6508224 39.73 246976 6860764 7484180 42.94 8549940 4966960 104 06:17:09 05:29:01 5342144 12587620 3355784 20.49 247016 6861076 4386064 25.16 5421044 4958192 560 06:17:09 05:30:01 3501824 10750120 5193284 31.70 248948 6861944 6571500 37.70 7263044 4947980 484 06:17:09 05:31:01 1139832 8390224 7551628 46.10 250168 6862784 8919616 51.17 9616644 4948292 348 06:17:09 05:32:01 1093908 8344532 7597264 46.38 250200 6862984 8953668 51.37 9663248 4948416 292 06:17:09 05:33:01 1057968 8309092 7632804 46.59 250248 6863432 8953668 51.37 9698244 4948856 236 06:17:09 05:34:01 795876 8047056 7894796 48.19 250256 6863480 9039588 51.86 9958428 4948828 408 06:17:09 05:35:01 794476 8045672 7896176 48.20 250272 6863484 9039588 51.86 9959724 4948832 164 06:17:09 05:36:01 793060 8044272 7897516 48.21 250284 6863492 9039588 51.86 9960928 4948836 140 06:17:09 05:37:01 790288 8041552 7900240 48.23 250304 6863520 9039588 51.86 9964100 4948860 316 06:17:09 05:38:01 591720 7843032 8098856 49.44 250336 6863548 9071708 52.05 10161740 4948892 156 06:17:09 05:39:01 591256 7842612 8099292 49.44 250360 6863552 9071708 52.05 10161660 4948892 328 06:17:09 05:40:01 2612352 10103200 5839216 35.65 257840 7089044 6750956 38.73 7974712 5118212 199968 06:17:09 05:41:01 5916864 13410568 2533276 15.46 259452 7090044 3392196 19.46 4704536 5095068 592 06:17:09 05:42:01 4200280 11695244 4248232 25.93 260236 7090504 5223012 29.97 6415192 5095464 164 06:17:09 05:43:01 5315024 12810232 3133372 19.13 260264 7090676 4123432 23.66 5315192 5084980 436 06:17:09 05:44:01 3506728 11003552 4939576 30.15 261704 7090816 5889304 33.79 7116620 5084956 124 06:17:09 05:45:01 3290540 10787708 5155268 31.47 261708 7091160 5956108 34.17 7331844 5085024 88 06:17:09 05:46:01 3183272 10681992 5260900 32.12 262572 7091820 6622576 38.00 7441304 5082780 396 06:17:09 05:47:01 2223904 9789184 6153088 37.56 264916 7151956 7798396 44.74 8338300 5141332 43584 06:17:09 05:48:01 1850984 9416888 6525208 39.83 265360 7152132 7950784 45.62 8708276 5141476 340 06:17:09 05:49:01 1797048 9362960 6579136 40.16 265360 7152140 7966988 45.71 8763048 5140912 124 06:17:09 05:50:01 1766888 9333116 6608996 40.34 265380 7152420 7983272 45.80 8789484 5140964 176 06:17:09 05:51:01 3597336 11163980 4779148 29.17 265512 7152604 6378636 36.60 6970684 5136060 836 06:17:09 05:52:01 1980908 9549164 6392900 39.03 266708 7152984 8447512 48.47 8592988 5127800 344 06:17:09 05:53:01 847704 8416816 7524760 45.93 267180 7153368 8744420 50.17 9719340 5127568 292 06:17:09 05:54:01 4587144 12156128 3786316 23.11 267188 7153232 5001636 28.70 5993384 5126740 284 06:17:09 05:55:01 4587248 12156252 3786232 23.11 267196 7153244 5001636 28.70 5994092 5126752 68 06:17:09 05:56:01 7449636 15103968 841960 5.14 269812 7231536 1689700 9.69 3071356 5198028 79988 06:17:09 05:57:01 3776240 11588932 4354556 26.58 273824 7382460 5209664 29.89 6624468 5297708 3340 06:17:09 05:58:01 3606192 11419040 4524276 27.62 273828 7382736 5295216 30.38 6795336 5297808 384 06:17:09 05:59:01 3618784 11431672 4511712 27.54 273832 7382756 5295216 30.38 6781008 5297816 244 06:17:09 06:00:01 3618612 11431500 4511860 27.54 273832 7382756 5295216 30.38 6780892 5297816 80 06:17:09 06:01:01 3618644 11431536 4511812 27.54 273832 7382760 5295216 30.38 6781048 5297820 172 06:17:09 06:02:01 4491532 12304588 3639396 22.22 273872 7382744 4922072 28.24 5932892 5279352 88 06:17:09 06:03:01 3727148 11541092 4402336 26.87 274320 7383184 5213336 29.91 6696376 5276204 248 06:17:09 06:04:01 3719832 11533960 4409456 26.92 274324 7383376 5213336 29.91 6703216 5276324 232 06:17:09 06:05:01 3704256 11518572 4424808 27.01 274328 7383552 5213336 29.91 6718368 5276500 156 06:17:09 06:06:01 3698988 11513480 4429888 27.04 274328 7383732 5229428 30.00 6723752 5276676 192 06:17:09 06:07:01 3683632 11498404 4444956 27.13 274328 7384004 5229428 30.00 6738552 5276956 516 06:17:09 06:08:01 3664456 11479564 4463732 27.25 274348 7384320 5245416 30.09 6756216 5277256 312 06:17:09 06:09:01 5506876 13322208 2622356 16.01 274428 7384440 3541272 20.32 4934784 5266464 676 06:17:09 06:10:02 3048500 10864248 5078680 31.00 274660 7384612 5894736 33.82 7383712 5266568 128 06:17:09 06:11:01 2975788 10792036 5150792 31.44 274664 7385180 5963764 34.22 7455392 5266976 772 06:17:09 06:12:01 2893856 10710864 5231928 31.94 274672 7385916 5997060 34.41 7536056 5267716 180 06:17:09 06:13:01 2861372 10679064 5263676 32.13 274672 7386580 5997060 34.41 7567364 5268376 504 06:17:09 06:14:01 2861404 10679168 5263556 32.13 274676 7386644 5997060 34.41 7566716 5268440 52 06:17:09 06:15:01 2861064 10678832 5263836 32.13 274680 7386644 5997060 34.41 7566632 5268440 96 06:17:09 06:16:01 7517996 15370872 574140 3.50 275980 7417412 1405764 8.07 2897024 5296980 17052 06:17:09 06:17:01 7343832 15391856 553592 3.38 280356 7596064 1301256 7.47 2906888 5448856 18404 06:17:09 Average: 3397729 10833577 5110721 31.20 252338 7048134 6148822 35.28 7187664 5133410 57209 06:17:09 06:17:09 05:13:02 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 06:17:09 05:14:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:14:01 lo 0.68 0.68 0.07 0.07 0.00 0.00 0.00 0.00 06:17:09 05:14:01 ens3 337.58 247.59 1650.76 71.70 0.00 0.00 0.00 0.00 06:17:09 05:15:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:15:01 lo 4.00 4.00 0.39 0.39 0.00 0.00 0.00 0.00 06:17:09 05:15:01 ens3 362.53 286.74 5626.86 32.68 0.00 0.00 0.00 0.00 06:17:09 05:16:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:16:01 lo 3.00 3.00 0.32 0.32 0.00 0.00 0.00 0.00 06:17:09 05:16:01 ens3 414.33 347.74 5858.75 35.00 0.00 0.00 0.00 0.00 06:17:09 05:17:02 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:17:02 lo 1.20 1.20 0.11 0.11 0.00 0.00 0.00 0.00 06:17:09 05:17:02 ens3 215.89 134.22 3964.74 13.68 0.00 0.00 0.00 0.00 06:17:09 05:18:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:18:01 lo 1.60 1.60 0.15 0.15 0.00 0.00 0.00 0.00 06:17:09 05:18:01 ens3 91.37 64.15 1409.32 5.52 0.00 0.00 0.00 0.00 06:17:09 05:19:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:19:01 lo 8.15 8.15 13.96 13.96 0.00 0.00 0.00 0.00 06:17:09 05:19:01 ens3 1.75 1.60 0.54 0.30 0.00 0.00 0.00 0.00 06:17:09 05:20:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:20:01 lo 48.76 48.76 37.45 37.45 0.00 0.00 0.00 0.00 06:17:09 05:20:01 ens3 2.30 1.92 0.60 0.49 0.00 0.00 0.00 0.00 06:17:09 05:21:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:21:01 lo 34.96 34.96 18.28 18.28 0.00 0.00 0.00 0.00 06:17:09 05:21:01 ens3 1.22 1.45 0.21 0.24 0.00 0.00 0.00 0.00 06:17:09 05:22:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:22:01 lo 7.97 7.97 3.21 3.21 0.00 0.00 0.00 0.00 06:17:09 05:22:01 ens3 1.75 2.22 0.80 0.73 0.00 0.00 0.00 0.00 06:17:09 05:23:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:23:01 lo 7.76 7.76 8.28 8.28 0.00 0.00 0.00 0.00 06:17:09 05:23:01 ens3 0.22 0.12 0.01 0.01 0.00 0.00 0.00 0.00 06:17:09 05:24:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:24:01 lo 0.55 0.55 0.05 0.05 0.00 0.00 0.00 0.00 06:17:09 05:24:01 ens3 0.38 0.20 0.14 0.07 0.00 0.00 0.00 0.00 06:17:09 05:25:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:25:01 lo 4.42 4.42 0.44 0.44 0.00 0.00 0.00 0.00 06:17:09 05:25:01 ens3 0.70 0.65 0.09 0.09 0.00 0.00 0.00 0.00 06:17:09 05:26:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:26:01 lo 22.61 22.61 18.05 18.05 0.00 0.00 0.00 0.00 06:17:09 05:26:01 ens3 1.57 1.88 0.29 0.30 0.00 0.00 0.00 0.00 06:17:09 05:27:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:27:01 lo 25.03 25.03 14.25 14.25 0.00 0.00 0.00 0.00 06:17:09 05:27:01 ens3 0.57 0.45 0.08 0.07 0.00 0.00 0.00 0.00 06:17:09 05:28:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:28:01 lo 19.46 19.46 8.62 8.62 0.00 0.00 0.00 0.00 06:17:09 05:28:01 ens3 0.28 0.18 0.04 0.03 0.00 0.00 0.00 0.00 06:17:09 05:29:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:29:01 lo 20.21 20.21 5.84 5.84 0.00 0.00 0.00 0.00 06:17:09 05:29:01 ens3 0.72 0.82 0.22 0.17 0.00 0.00 0.00 0.00 06:17:09 05:30:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:30:01 lo 22.06 22.06 7.82 7.82 0.00 0.00 0.00 0.00 06:17:09 05:30:01 ens3 1.15 1.08 0.16 0.15 0.00 0.00 0.00 0.00 06:17:09 05:31:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:31:01 lo 34.21 34.21 12.46 12.46 0.00 0.00 0.00 0.00 06:17:09 05:31:01 ens3 0.82 0.95 0.13 0.14 0.00 0.00 0.00 0.00 06:17:09 05:32:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:32:01 lo 9.18 9.18 7.04 7.04 0.00 0.00 0.00 0.00 06:17:09 05:32:01 ens3 1.98 1.93 0.53 0.48 0.00 0.00 0.00 0.00 06:17:09 05:33:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:33:01 lo 32.83 32.83 13.22 13.22 0.00 0.00 0.00 0.00 06:17:09 05:33:01 ens3 1.42 1.47 0.50 0.43 0.00 0.00 0.00 0.00 06:17:09 05:34:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:34:01 lo 9.85 9.85 5.65 5.65 0.00 0.00 0.00 0.00 06:17:09 05:34:01 ens3 0.83 0.62 0.25 0.17 0.00 0.00 0.00 0.00 06:17:09 05:35:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:35:01 lo 1.20 1.20 0.12 0.12 0.00 0.00 0.00 0.00 06:17:09 05:35:01 ens3 0.53 0.10 0.05 0.01 0.00 0.00 0.00 0.00 06:17:09 05:36:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:36:01 lo 0.90 0.90 0.09 0.09 0.00 0.00 0.00 0.00 06:17:09 05:36:01 ens3 0.37 0.22 0.25 0.21 0.00 0.00 0.00 0.00 06:17:09 05:37:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:37:01 lo 2.33 2.33 0.73 0.73 0.00 0.00 0.00 0.00 06:17:09 05:37:01 ens3 0.50 0.40 0.08 0.07 0.00 0.00 0.00 0.00 06:17:09 05:38:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:38:01 lo 6.17 6.17 3.65 3.65 0.00 0.00 0.00 0.00 06:17:09 05:38:01 ens3 0.13 0.07 0.02 0.01 0.00 0.00 0.00 0.00 06:17:09 05:39:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:39:01 lo 0.75 0.75 0.07 0.07 0.00 0.00 0.00 0.00 06:17:09 05:39:01 ens3 0.48 0.23 0.15 0.07 0.00 0.00 0.00 0.00 06:17:09 05:40:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:40:01 lo 3.68 3.68 0.61 0.61 0.00 0.00 0.00 0.00 06:17:09 05:40:01 ens3 1.67 1.82 0.78 0.68 0.00 0.00 0.00 0.00 06:17:09 05:41:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:41:01 lo 31.81 31.81 27.18 27.18 0.00 0.00 0.00 0.00 06:17:09 05:41:01 ens3 2.18 1.95 0.42 0.38 0.00 0.00 0.00 0.00 06:17:09 05:42:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:42:01 lo 28.79 28.79 10.10 10.10 0.00 0.00 0.00 0.00 06:17:09 05:42:01 ens3 1.18 1.13 0.24 0.22 0.00 0.00 0.00 0.00 06:17:09 05:43:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:43:01 lo 22.15 22.15 6.75 6.75 0.00 0.00 0.00 0.00 06:17:09 05:43:01 ens3 1.18 1.07 0.22 0.20 0.00 0.00 0.00 0.00 06:17:09 05:44:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:44:01 lo 18.10 18.10 11.69 11.69 0.00 0.00 0.00 0.00 06:17:09 05:44:01 ens3 1.08 0.88 0.29 0.21 0.00 0.00 0.00 0.00 06:17:09 05:45:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:45:01 lo 56.54 56.54 19.10 19.10 0.00 0.00 0.00 0.00 06:17:09 05:45:01 ens3 1.80 1.80 0.37 0.35 0.00 0.00 0.00 0.00 06:17:09 05:46:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:46:01 lo 32.36 32.36 17.68 17.68 0.00 0.00 0.00 0.00 06:17:09 05:46:01 ens3 1.50 1.75 0.26 0.26 0.00 0.00 0.00 0.00 06:17:09 05:47:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:47:01 lo 3.83 3.83 0.49 0.49 0.00 0.00 0.00 0.00 06:17:09 05:47:01 ens3 2.18 2.47 0.86 0.76 0.00 0.00 0.00 0.00 06:17:09 05:48:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:48:01 lo 14.30 14.30 9.99 9.99 0.00 0.00 0.00 0.00 06:17:09 05:48:01 ens3 1.20 1.62 0.25 0.26 0.00 0.00 0.00 0.00 06:17:09 05:49:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:49:01 lo 1.05 1.05 0.15 0.15 0.00 0.00 0.00 0.00 06:17:09 05:49:01 ens3 0.42 0.33 0.15 0.09 0.00 0.00 0.00 0.00 06:17:09 05:50:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:50:01 lo 2.17 2.17 4.90 4.90 0.00 0.00 0.00 0.00 06:17:09 05:50:01 ens3 0.17 0.03 0.01 0.00 0.00 0.00 0.00 0.00 06:17:09 05:51:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:51:01 lo 1.70 1.70 0.16 0.16 0.00 0.00 0.00 0.00 06:17:09 05:51:01 ens3 0.48 0.48 0.06 0.07 0.00 0.00 0.00 0.00 06:17:09 05:52:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:52:01 lo 13.55 13.55 4.66 4.66 0.00 0.00 0.00 0.00 06:17:09 05:52:01 ens3 0.83 0.87 0.12 0.12 0.00 0.00 0.00 0.00 06:17:09 05:53:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:53:01 lo 26.70 26.70 14.66 14.66 0.00 0.00 0.00 0.00 06:17:09 05:53:01 ens3 0.93 1.27 0.19 0.21 0.00 0.00 0.00 0.00 06:17:09 05:54:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:54:01 lo 5.38 5.38 4.77 4.77 0.00 0.00 0.00 0.00 06:17:09 05:54:01 ens3 1.77 1.88 0.44 0.91 0.00 0.00 0.00 0.00 06:17:09 05:55:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:55:01 lo 0.20 0.20 0.01 0.01 0.00 0.00 0.00 0.00 06:17:09 05:55:01 ens3 0.22 0.10 0.02 0.01 0.00 0.00 0.00 0.00 06:17:09 05:56:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:56:01 lo 1.43 1.43 0.08 0.08 0.00 0.00 0.00 0.00 06:17:09 05:56:01 ens3 32.53 27.86 8.37 24.88 0.00 0.00 0.00 0.00 06:17:09 05:57:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:57:01 lo 35.48 35.48 32.60 32.60 0.00 0.00 0.00 0.00 06:17:09 05:57:01 ens3 0.65 0.60 0.08 0.08 0.00 0.00 0.00 0.00 06:17:09 05:58:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:58:01 lo 35.07 35.07 14.30 14.30 0.00 0.00 0.00 0.00 06:17:09 05:58:01 ens3 1.38 1.25 0.28 0.27 0.00 0.00 0.00 0.00 06:17:09 05:59:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 05:59:01 lo 1.98 1.98 0.64 0.64 0.00 0.00 0.00 0.00 06:17:09 05:59:01 ens3 0.48 0.30 0.17 0.09 0.00 0.00 0.00 0.00 06:17:09 06:00:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:00:01 lo 0.22 0.22 0.02 0.02 0.00 0.00 0.00 0.00 06:17:09 06:00:01 ens3 0.17 0.05 0.01 0.00 0.00 0.00 0.00 0.00 06:17:09 06:01:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:01:01 lo 0.33 0.33 0.02 0.02 0.00 0.00 0.00 0.00 06:17:09 06:01:01 ens3 0.23 0.10 0.01 0.01 0.00 0.00 0.00 0.00 06:17:09 06:02:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:02:01 lo 1.82 1.82 0.16 0.16 0.00 0.00 0.00 0.00 06:17:09 06:02:01 ens3 0.60 0.50 0.08 0.07 0.00 0.00 0.00 0.00 06:17:09 06:03:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:03:01 lo 37.68 37.68 19.43 19.43 0.00 0.00 0.00 0.00 06:17:09 06:03:01 ens3 0.90 0.83 0.18 0.16 0.00 0.00 0.00 0.00 06:17:09 06:04:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:04:01 lo 12.03 12.03 5.37 5.37 0.00 0.00 0.00 0.00 06:17:09 06:04:01 ens3 0.90 0.73 0.28 0.20 0.00 0.00 0.00 0.00 06:17:09 06:05:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:05:01 lo 20.28 20.28 7.65 7.65 0.00 0.00 0.00 0.00 06:17:09 06:05:01 ens3 0.43 0.30 0.06 0.05 0.00 0.00 0.00 0.00 06:17:09 06:06:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:06:01 lo 18.36 18.36 7.56 7.56 0.00 0.00 0.00 0.00 06:17:09 06:06:01 ens3 0.85 0.73 0.17 0.15 0.00 0.00 0.00 0.00 06:17:09 06:07:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:07:01 lo 28.61 28.61 9.53 9.53 0.00 0.00 0.00 0.00 06:17:09 06:07:01 ens3 0.68 0.58 0.12 0.11 0.00 0.00 0.00 0.00 06:17:09 06:08:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:08:01 lo 20.43 20.43 7.62 7.62 0.00 0.00 0.00 0.00 06:17:09 06:08:01 ens3 0.58 0.55 0.12 0.11 0.00 0.00 0.00 0.00 06:17:09 06:09:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:09:01 lo 36.64 36.64 11.51 11.51 0.00 0.00 0.00 0.00 06:17:09 06:09:01 ens3 1.00 0.83 0.22 0.20 0.00 0.00 0.00 0.00 06:17:09 06:10:02 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:10:02 lo 40.71 40.71 20.83 20.83 0.00 0.00 0.00 0.00 06:17:09 06:10:02 ens3 0.77 0.63 0.17 0.11 0.00 0.00 0.00 0.00 06:17:09 06:11:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:11:01 lo 43.55 43.55 15.59 15.59 0.00 0.00 0.00 0.00 06:17:09 06:11:01 ens3 1.22 0.81 0.21 0.16 0.00 0.00 0.00 0.00 06:17:09 06:12:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:12:01 lo 60.19 60.19 20.80 20.80 0.00 0.00 0.00 0.00 06:17:09 06:12:01 ens3 1.52 0.58 0.47 0.30 0.00 0.00 0.00 0.00 06:17:09 06:13:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:13:01 lo 72.90 72.90 23.82 23.82 0.00 0.00 0.00 0.00 06:17:09 06:13:01 ens3 1.22 0.77 0.63 0.49 0.00 0.00 0.00 0.00 06:17:09 06:14:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:14:01 lo 0.12 0.12 0.01 0.01 0.00 0.00 0.00 0.00 06:17:09 06:14:01 ens3 0.38 0.10 0.14 0.06 0.00 0.00 0.00 0.00 06:17:09 06:15:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:15:01 lo 0.40 0.40 0.04 0.04 0.00 0.00 0.00 0.00 06:17:09 06:15:01 ens3 0.32 0.10 0.02 0.01 0.00 0.00 0.00 0.00 06:17:09 06:16:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:16:01 lo 0.43 0.43 0.04 0.04 0.00 0.00 0.00 0.00 06:17:09 06:16:01 ens3 1.33 1.38 0.71 0.61 0.00 0.00 0.00 0.00 06:17:09 06:17:01 docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 06:17:01 lo 1.20 1.20 0.11 0.11 0.00 0.00 0.00 0.00 06:17:09 06:17:01 ens3 147.53 118.83 1964.70 25.70 0.00 0.00 0.00 0.00 06:17:09 Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 06:17:09 Average: lo 16.59 16.59 7.99 7.99 0.00 0.00 0.00 0.00 06:17:09 Average: ens3 25.79 19.89 319.85 3.44 0.00 0.00 0.00 0.00 06:17:09 06:17:09 06:17:09 ---> sar -P ALL: 06:17:09 Linux 5.4.0-190-generic (prd-ubuntu2004-docker-4c-16g-42530) 10/15/24 _x86_64_ (4 CPU) 06:17:09 06:17:09 05:12:37 LINUX RESTART (4 CPU) 06:17:09 06:17:09 05:13:02 CPU %user %nice %system %iowait %steal %idle 06:17:09 05:14:01 all 20.08 15.04 11.95 4.14 0.11 48.68 06:17:09 05:14:01 0 18.39 14.54 11.50 6.00 0.12 49.46 06:17:09 05:14:01 1 17.87 17.06 13.18 1.93 0.12 49.85 06:17:09 05:14:01 2 27.53 12.92 10.93 5.36 0.12 43.15 06:17:09 05:14:01 3 16.54 15.65 12.18 3.28 0.09 52.26 06:17:09 05:15:01 all 42.93 0.00 3.62 4.32 0.07 49.06 06:17:09 05:15:01 0 40.58 0.00 3.35 5.51 0.07 50.50 06:17:09 05:15:01 1 40.37 0.00 3.58 3.18 0.07 52.81 06:17:09 05:15:01 2 56.09 0.00 3.97 4.62 0.08 35.23 06:17:09 05:15:01 3 34.73 0.00 3.57 3.96 0.07 57.68 06:17:09 05:16:01 all 76.54 0.00 2.95 1.90 0.11 18.51 06:17:09 05:16:01 0 80.98 0.00 1.64 0.23 0.10 17.05 06:17:09 05:16:01 1 69.56 0.00 3.19 5.34 0.10 21.80 06:17:09 05:16:01 2 79.88 0.00 3.96 1.34 0.10 14.73 06:17:09 05:16:01 3 75.71 0.00 3.01 0.70 0.13 20.44 06:17:09 05:17:02 all 66.05 0.00 3.65 2.99 0.13 27.17 06:17:09 05:17:02 0 60.65 0.00 3.37 1.52 0.17 34.29 06:17:09 05:17:02 1 59.35 0.00 3.96 3.38 0.13 33.17 06:17:09 05:17:02 2 87.16 0.00 3.95 3.14 0.12 5.63 06:17:09 05:17:02 3 56.91 0.00 3.32 3.93 0.12 35.72 06:17:09 05:18:01 all 78.04 0.00 4.14 9.77 0.15 7.90 06:17:09 05:18:01 0 80.47 0.00 4.05 8.27 0.14 7.07 06:17:09 05:18:01 1 72.10 0.00 4.68 11.57 0.16 11.50 06:17:09 05:18:01 2 79.29 0.00 4.45 7.94 0.16 8.16 06:17:09 05:18:01 3 80.25 0.00 3.39 11.30 0.17 4.88 06:17:09 05:19:01 all 73.42 0.00 2.82 0.66 0.13 22.98 06:17:09 05:19:01 0 73.52 0.00 2.68 1.11 0.13 22.55 06:17:09 05:19:01 1 72.04 0.00 2.50 0.57 0.12 24.77 06:17:09 05:19:01 2 74.66 0.00 3.07 0.29 0.13 21.85 06:17:09 05:19:01 3 73.46 0.00 3.00 0.67 0.12 22.74 06:17:09 05:20:01 all 55.57 0.00 1.73 0.30 0.11 42.29 06:17:09 05:20:01 0 52.57 0.00 1.73 0.70 0.12 44.88 06:17:09 05:20:01 1 58.63 0.00 1.39 0.03 0.12 39.83 06:17:09 05:20:01 2 55.20 0.00 1.63 0.10 0.10 42.97 06:17:09 05:20:01 3 55.88 0.00 2.16 0.37 0.12 41.47 06:17:09 05:21:01 all 25.18 0.00 1.06 0.29 0.11 73.36 06:17:09 05:21:01 0 25.41 0.00 0.94 0.70 0.12 72.83 06:17:09 05:21:01 1 25.11 0.00 0.94 0.34 0.10 73.51 06:17:09 05:21:01 2 24.65 0.00 1.27 0.00 0.12 73.96 06:17:09 05:21:01 3 25.57 0.00 1.07 0.12 0.10 73.14 06:17:09 05:22:01 all 49.33 0.00 2.11 0.48 0.10 47.98 06:17:09 05:22:01 0 59.01 0.00 2.56 1.17 0.08 37.16 06:17:09 05:22:01 1 42.93 0.00 2.15 0.05 0.10 54.77 06:17:09 05:22:01 2 50.19 0.00 1.87 0.08 0.10 47.76 06:17:09 05:22:01 3 45.17 0.00 1.85 0.62 0.10 52.26 06:17:09 05:23:01 all 5.80 0.00 0.36 0.83 0.08 92.93 06:17:09 05:23:01 0 4.82 0.00 0.42 0.37 0.08 94.30 06:17:09 05:23:01 1 5.97 0.00 0.27 0.03 0.08 93.64 06:17:09 05:23:01 2 6.39 0.00 0.42 1.19 0.08 91.91 06:17:09 05:23:01 3 6.00 0.00 0.32 1.71 0.08 91.88 06:17:09 05:24:01 all 0.83 0.00 0.20 0.01 0.08 98.88 06:17:09 05:24:01 0 1.47 0.00 0.23 0.00 0.08 98.21 06:17:09 05:24:01 1 0.75 0.00 0.12 0.00 0.08 99.05 06:17:09 05:24:01 2 0.64 0.00 0.30 0.03 0.10 98.92 06:17:09 05:24:01 3 0.44 0.00 0.15 0.02 0.07 99.33 06:17:09 06:17:09 05:24:01 CPU %user %nice %system %iowait %steal %idle 06:17:09 05:25:01 all 50.81 0.00 1.81 0.05 0.10 47.23 06:17:09 05:25:01 0 45.56 0.00 1.86 0.02 0.10 52.46 06:17:09 05:25:01 1 49.33 0.00 2.04 0.02 0.08 48.53 06:17:09 05:25:01 2 56.32 0.00 1.63 0.03 0.08 41.94 06:17:09 05:25:01 3 52.04 0.00 1.71 0.15 0.12 45.98 06:17:09 05:26:01 all 33.84 0.00 1.22 0.24 0.09 64.60 06:17:09 05:26:01 0 31.76 0.00 1.07 0.02 0.08 67.07 06:17:09 05:26:01 1 35.04 0.00 1.30 0.38 0.10 63.18 06:17:09 05:26:01 2 34.22 0.00 1.02 0.03 0.10 64.62 06:17:09 05:26:01 3 34.35 0.00 1.48 0.54 0.08 63.55 06:17:09 05:27:01 all 30.16 0.00 1.06 0.28 0.10 68.41 06:17:09 05:27:01 0 30.60 0.00 1.14 0.35 0.10 67.81 06:17:09 05:27:01 1 29.45 0.00 0.89 0.03 0.10 69.53 06:17:09 05:27:01 2 29.40 0.00 1.25 0.62 0.12 68.62 06:17:09 05:27:01 3 31.18 0.00 0.95 0.10 0.10 67.67 06:17:09 05:28:01 all 3.91 0.00 0.37 0.02 0.10 95.60 06:17:09 05:28:01 0 3.67 0.00 0.37 0.02 0.10 95.85 06:17:09 05:28:01 1 3.93 0.00 0.37 0.02 0.10 95.58 06:17:09 05:28:01 2 4.12 0.00 0.40 0.03 0.10 95.34 06:17:09 05:28:01 3 3.93 0.00 0.33 0.02 0.10 95.61 06:17:09 05:29:01 all 17.57 0.00 0.91 0.06 0.08 81.38 06:17:09 05:29:01 0 18.29 0.00 0.70 0.02 0.08 80.91 06:17:09 05:29:01 1 17.65 0.00 0.92 0.02 0.08 81.32 06:17:09 05:29:01 2 18.47 0.00 0.89 0.13 0.08 80.43 06:17:09 05:29:01 3 15.87 0.00 1.14 0.07 0.07 82.86 06:17:09 05:30:01 all 74.75 0.00 2.56 0.05 0.12 22.52 06:17:09 05:30:01 0 72.56 0.00 2.94 0.12 0.10 24.29 06:17:09 05:30:01 1 76.51 0.00 2.19 0.00 0.13 21.16 06:17:09 05:30:01 2 74.41 0.00 2.55 0.00 0.12 22.92 06:17:09 05:30:01 3 75.50 0.00 2.55 0.10 0.12 21.72 06:17:09 05:31:01 all 29.83 0.00 1.11 0.29 0.11 68.66 06:17:09 05:31:01 0 28.73 0.00 1.03 0.64 0.12 69.48 06:17:09 05:31:01 1 29.57 0.00 1.27 0.00 0.10 69.06 06:17:09 05:31:01 2 30.24 0.00 1.39 0.52 0.10 67.75 06:17:09 05:31:01 3 30.77 0.00 0.75 0.02 0.12 68.34 06:17:09 05:32:01 all 2.74 0.00 0.40 0.06 0.07 96.72 06:17:09 05:32:01 0 2.62 0.00 0.30 0.23 0.05 96.80 06:17:09 05:32:01 1 2.18 0.00 0.47 0.00 0.08 97.27 06:17:09 05:32:01 2 2.99 0.00 0.42 0.02 0.08 96.49 06:17:09 05:32:01 3 3.19 0.00 0.40 0.00 0.07 96.35 06:17:09 05:33:01 all 4.61 0.00 0.39 0.04 0.09 94.87 06:17:09 05:33:01 0 3.41 0.00 0.30 0.08 0.08 96.12 06:17:09 05:33:01 1 4.73 0.00 0.44 0.02 0.08 94.74 06:17:09 05:33:01 2 4.98 0.00 0.37 0.05 0.10 94.50 06:17:09 05:33:01 3 5.32 0.00 0.47 0.00 0.08 94.13 06:17:09 05:34:01 all 4.79 0.00 0.38 0.02 0.08 94.74 06:17:09 05:34:01 0 4.65 0.00 0.37 0.03 0.07 94.88 06:17:09 05:34:01 1 5.07 0.00 0.47 0.03 0.08 94.34 06:17:09 05:34:01 2 5.00 0.00 0.27 0.00 0.07 94.67 06:17:09 05:34:01 3 4.46 0.00 0.40 0.00 0.08 95.05 06:17:09 05:35:01 all 0.70 0.00 0.32 0.02 0.10 98.86 06:17:09 05:35:01 0 0.65 0.00 0.30 0.03 0.10 98.91 06:17:09 05:35:01 1 0.55 0.00 0.27 0.00 0.08 99.10 06:17:09 05:35:01 2 0.84 0.00 0.37 0.03 0.10 98.66 06:17:09 05:35:01 3 0.77 0.00 0.35 0.00 0.10 98.77 06:17:09 06:17:09 05:35:01 CPU %user %nice %system %iowait %steal %idle 06:17:09 05:36:01 all 0.82 0.00 0.24 0.01 0.08 98.85 06:17:09 05:36:01 0 0.64 0.00 0.20 0.02 0.08 99.06 06:17:09 05:36:01 1 0.64 0.00 0.34 0.00 0.08 98.94 06:17:09 05:36:01 2 0.99 0.00 0.23 0.02 0.07 98.69 06:17:09 05:36:01 3 1.02 0.00 0.20 0.00 0.07 98.71 06:17:09 05:37:01 all 1.36 0.00 0.33 0.01 0.10 98.20 06:17:09 05:37:01 0 1.07 0.00 0.22 0.05 0.10 98.56 06:17:09 05:37:01 1 0.92 0.00 0.27 0.00 0.10 98.71 06:17:09 05:37:01 2 1.37 0.00 0.52 0.00 0.10 98.01 06:17:09 05:37:01 3 2.08 0.00 0.30 0.00 0.08 97.53 06:17:09 05:38:01 all 3.76 0.00 0.30 0.02 0.09 95.83 06:17:09 05:38:01 0 3.17 0.00 0.30 0.03 0.08 96.41 06:17:09 05:38:01 1 3.24 0.00 0.18 0.00 0.08 96.49 06:17:09 05:38:01 2 4.85 0.00 0.30 0.00 0.10 94.75 06:17:09 05:38:01 3 3.79 0.00 0.42 0.03 0.10 95.66 06:17:09 05:39:01 all 0.61 0.00 0.27 0.01 0.08 99.02 06:17:09 05:39:01 0 0.82 0.00 0.33 0.02 0.08 98.74 06:17:09 05:39:01 1 0.54 0.00 0.23 0.00 0.10 99.13 06:17:09 05:39:01 2 0.54 0.00 0.27 0.00 0.07 99.13 06:17:09 05:39:01 3 0.55 0.00 0.23 0.03 0.08 99.10 06:17:09 05:40:01 all 32.75 0.00 1.42 0.62 0.10 65.10 06:17:09 05:40:01 0 33.76 0.00 1.17 0.02 0.10 64.95 06:17:09 05:40:01 1 31.97 0.00 1.34 1.66 0.10 64.94 06:17:09 05:40:01 2 33.12 0.00 1.47 0.03 0.10 65.28 06:17:09 05:40:01 3 32.17 0.00 1.71 0.77 0.10 65.25 06:17:09 05:41:01 all 38.68 0.00 1.56 0.98 0.12 58.67 06:17:09 05:41:01 0 37.65 0.00 1.37 0.37 0.17 60.44 06:17:09 05:41:01 1 39.92 0.00 1.41 0.77 0.08 57.82 06:17:09 05:41:01 2 39.30 0.00 1.76 0.23 0.12 58.58 06:17:09 05:41:01 3 37.83 0.00 1.71 2.54 0.10 57.82 06:17:09 05:42:01 all 29.90 0.00 1.08 0.25 0.10 68.67 06:17:09 05:42:01 0 30.14 0.00 0.97 0.02 0.10 68.77 06:17:09 05:42:01 1 29.56 0.00 1.10 0.62 0.10 68.62 06:17:09 05:42:01 2 30.84 0.00 1.10 0.00 0.10 67.96 06:17:09 05:42:01 3 29.05 0.00 1.15 0.37 0.10 69.33 06:17:09 05:43:01 all 14.92 0.00 0.73 0.05 0.09 84.20 06:17:09 05:43:01 0 14.90 0.00 0.85 0.00 0.08 84.17 06:17:09 05:43:01 1 15.38 0.00 0.77 0.03 0.12 83.70 06:17:09 05:43:01 2 13.82 0.00 0.65 0.17 0.07 85.30 06:17:09 05:43:01 3 15.60 0.00 0.64 0.02 0.10 83.65 06:17:09 05:44:01 all 26.28 0.00 1.05 0.26 0.10 72.30 06:17:09 05:44:01 0 27.01 0.00 0.66 0.00 0.10 72.23 06:17:09 05:44:01 1 28.39 0.00 1.44 0.55 0.10 69.52 06:17:09 05:44:01 2 24.28 0.00 0.85 0.00 0.10 74.77 06:17:09 05:44:01 3 25.43 0.00 1.25 0.50 0.10 72.71 06:17:09 05:45:01 all 9.74 0.00 0.63 0.01 0.10 89.52 06:17:09 05:45:01 0 10.20 0.00 0.58 0.00 0.08 89.13 06:17:09 05:45:01 1 9.90 0.00 0.77 0.03 0.10 89.20 06:17:09 05:45:01 2 9.42 0.00 0.50 0.00 0.10 89.97 06:17:09 05:45:01 3 9.44 0.00 0.68 0.02 0.10 89.76 06:17:09 05:46:01 all 66.44 0.00 2.11 0.10 0.12 31.23 06:17:09 05:46:01 0 65.23 0.00 2.17 0.10 0.12 32.39 06:17:09 05:46:01 1 65.85 0.00 2.31 0.10 0.12 31.62 06:17:09 05:46:01 2 67.86 0.00 1.67 0.02 0.13 30.31 06:17:09 05:46:01 3 66.81 0.00 2.30 0.17 0.12 30.61 06:17:09 06:17:09 05:46:01 CPU %user %nice %system %iowait %steal %idle 06:17:09 05:47:01 all 35.76 0.00 1.27 0.13 0.11 62.73 06:17:09 05:47:01 0 34.02 0.00 1.45 0.00 0.10 64.43 06:17:09 05:47:01 1 42.21 0.00 1.58 0.35 0.10 55.76 06:17:09 05:47:01 2 30.92 0.00 1.09 0.00 0.10 67.89 06:17:09 05:47:01 3 35.90 0.00 0.98 0.15 0.12 62.86 06:17:09 05:48:01 all 9.99 0.00 0.41 0.55 0.08 88.97 06:17:09 05:48:01 0 10.15 0.00 0.47 0.03 0.08 89.26 06:17:09 05:48:01 1 9.49 0.00 0.45 0.87 0.08 89.10 06:17:09 05:48:01 2 10.41 0.00 0.35 0.03 0.10 89.10 06:17:09 05:48:01 3 9.91 0.00 0.35 1.24 0.07 88.43 06:17:09 05:49:01 all 1.31 0.00 0.21 0.01 0.09 98.38 06:17:09 05:49:01 0 1.74 0.00 0.22 0.03 0.08 97.93 06:17:09 05:49:01 1 1.90 0.00 0.22 0.00 0.08 97.80 06:17:09 05:49:01 2 1.06 0.00 0.18 0.00 0.08 98.67 06:17:09 05:49:01 3 0.54 0.00 0.20 0.02 0.10 99.14 06:17:09 05:50:01 all 2.47 0.00 0.19 0.03 0.08 97.22 06:17:09 05:50:01 0 2.48 0.00 0.25 0.03 0.08 97.15 06:17:09 05:50:01 1 2.08 0.00 0.20 0.00 0.08 97.63 06:17:09 05:50:01 2 2.09 0.00 0.12 0.00 0.07 97.72 06:17:09 05:50:01 3 3.25 0.00 0.20 0.10 0.08 96.37 06:17:09 05:51:01 all 21.39 0.00 0.92 0.02 0.09 77.59 06:17:09 05:51:01 0 21.54 0.00 1.04 0.03 0.10 77.28 06:17:09 05:51:01 1 20.89 0.00 0.82 0.00 0.08 78.20 06:17:09 05:51:01 2 20.37 0.00 1.01 0.02 0.08 78.52 06:17:09 05:51:01 3 22.73 0.00 0.81 0.03 0.08 76.34 06:17:09 05:52:01 all 48.44 0.00 1.57 0.33 0.11 49.55 06:17:09 05:52:01 0 45.39 0.00 1.89 1.17 0.10 51.44 06:17:09 05:52:01 1 48.43 0.00 1.74 0.08 0.12 49.62 06:17:09 05:52:01 2 49.98 0.00 1.34 0.00 0.12 48.56 06:17:09 05:52:01 3 49.93 0.00 1.32 0.05 0.10 48.60 06:17:09 05:53:01 all 19.43 0.00 0.65 0.20 0.10 79.61 06:17:09 05:53:01 0 19.55 0.00 0.57 0.54 0.10 79.25 06:17:09 05:53:01 1 19.95 0.00 0.74 0.02 0.10 79.20 06:17:09 05:53:01 2 18.83 0.00 0.62 0.00 0.10 80.45 06:17:09 05:53:01 3 19.41 0.00 0.69 0.25 0.10 79.55 06:17:09 05:54:01 all 1.39 0.00 0.34 0.01 0.10 98.16 06:17:09 05:54:01 0 1.25 0.00 0.32 0.03 0.10 98.29 06:17:09 05:54:01 1 1.06 0.00 0.34 0.00 0.08 98.52 06:17:09 05:54:01 2 1.34 0.00 0.33 0.00 0.13 98.19 06:17:09 05:54:01 3 1.91 0.00 0.37 0.00 0.10 97.62 06:17:09 05:55:01 all 0.33 0.00 0.08 0.02 0.07 99.51 06:17:09 05:55:01 0 0.18 0.00 0.07 0.03 0.05 99.67 06:17:09 05:55:01 1 0.70 0.00 0.08 0.03 0.07 99.12 06:17:09 05:55:01 2 0.25 0.00 0.12 0.00 0.07 99.56 06:17:09 05:55:01 3 0.17 0.00 0.07 0.00 0.08 99.68 06:17:09 05:56:01 all 10.54 0.00 0.62 0.10 0.07 88.67 06:17:09 05:56:01 0 6.64 0.00 0.77 0.27 0.08 92.23 06:17:09 05:56:01 1 5.52 0.00 0.40 0.00 0.05 94.03 06:17:09 05:56:01 2 23.44 0.00 0.77 0.12 0.07 75.61 06:17:09 05:56:01 3 6.53 0.00 0.55 0.00 0.08 92.83 06:17:09 05:57:01 all 54.17 0.00 1.50 0.86 0.10 43.38 06:17:09 05:57:01 0 55.45 0.00 1.49 0.03 0.10 42.93 06:17:09 05:57:01 1 57.15 0.00 1.52 0.35 0.08 40.89 06:17:09 05:57:01 2 56.46 0.00 1.31 1.49 0.10 40.64 06:17:09 05:57:01 3 47.64 0.00 1.69 1.54 0.10 49.03 06:17:09 06:17:09 05:57:01 CPU %user %nice %system %iowait %steal %idle 06:17:09 05:58:01 all 4.79 0.00 0.28 0.08 0.10 94.76 06:17:09 05:58:01 0 4.95 0.00 0.29 0.03 0.08 94.65 06:17:09 05:58:01 1 4.73 0.00 0.27 0.00 0.10 94.91 06:17:09 05:58:01 2 4.89 0.00 0.22 0.18 0.08 94.62 06:17:09 05:58:01 3 4.58 0.00 0.35 0.08 0.12 94.86 06:17:09 05:59:01 all 0.42 0.00 0.11 0.07 0.09 99.31 06:17:09 05:59:01 0 0.42 0.00 0.08 0.02 0.08 99.40 06:17:09 05:59:01 1 0.44 0.00 0.15 0.00 0.08 99.33 06:17:09 05:59:01 2 0.37 0.00 0.10 0.23 0.10 99.20 06:17:09 05:59:01 3 0.45 0.00 0.12 0.03 0.08 99.32 06:17:09 06:00:01 all 0.46 0.00 0.12 0.24 0.15 99.03 06:17:09 06:00:01 0 0.62 0.00 0.10 0.15 0.05 99.08 06:17:09 06:00:01 1 0.50 0.00 0.20 0.00 0.10 99.20 06:17:09 06:00:01 2 0.40 0.00 0.08 0.80 0.07 98.65 06:17:09 06:00:01 3 0.30 0.00 0.10 0.00 0.40 99.20 06:17:09 06:01:01 all 0.53 0.00 0.11 0.13 0.06 99.17 06:17:09 06:01:01 0 0.75 0.00 0.07 0.05 0.07 99.06 06:17:09 06:01:01 1 0.35 0.00 0.12 0.00 0.07 99.47 06:17:09 06:01:01 2 0.80 0.00 0.13 0.45 0.07 98.55 06:17:09 06:01:01 3 0.22 0.00 0.12 0.00 0.05 99.62 06:17:09 06:02:01 all 36.92 0.00 1.46 0.11 0.11 61.40 06:17:09 06:02:01 0 34.41 0.00 1.52 0.10 0.12 63.85 06:17:09 06:02:01 1 39.68 0.00 1.11 0.05 0.12 59.04 06:17:09 06:02:01 2 34.88 0.00 1.55 0.28 0.12 63.17 06:17:09 06:02:01 3 38.71 0.00 1.63 0.02 0.10 59.54 06:17:09 06:03:01 all 22.66 0.00 0.67 0.34 0.10 76.23 06:17:09 06:03:01 0 22.20 0.00 0.85 0.72 0.08 76.15 06:17:09 06:03:01 1 23.35 0.00 0.60 0.03 0.10 75.91 06:17:09 06:03:01 2 22.59 0.00 0.55 0.62 0.10 76.14 06:17:09 06:03:01 3 22.50 0.00 0.67 0.00 0.12 76.71 06:17:09 06:04:01 all 2.89 0.00 0.35 0.12 0.10 96.55 06:17:09 06:04:01 0 3.21 0.00 0.35 0.15 0.07 96.23 06:17:09 06:04:01 1 2.87 0.00 0.38 0.03 0.12 96.60 06:17:09 06:04:01 2 2.75 0.00 0.33 0.28 0.10 96.53 06:17:09 06:04:01 3 2.74 0.00 0.32 0.00 0.10 96.85 06:17:09 06:05:01 all 2.87 0.00 0.30 0.03 0.09 96.72 06:17:09 06:05:01 0 2.67 0.00 0.37 0.07 0.10 96.80 06:17:09 06:05:01 1 2.78 0.00 0.37 0.00 0.08 96.77 06:17:09 06:05:01 2 2.17 0.00 0.17 0.05 0.07 97.54 06:17:09 06:05:01 3 3.85 0.00 0.28 0.00 0.10 95.77 06:17:09 06:06:01 all 2.42 0.00 0.24 0.00 0.08 97.26 06:17:09 06:06:01 0 2.23 0.00 0.25 0.00 0.07 97.45 06:17:09 06:06:01 1 1.95 0.00 0.18 0.00 0.10 97.76 06:17:09 06:06:01 2 1.90 0.00 0.22 0.02 0.07 97.80 06:17:09 06:06:01 3 3.58 0.00 0.30 0.00 0.10 96.02 06:17:09 06:07:01 all 3.09 0.00 0.29 0.01 0.08 96.53 06:17:09 06:07:01 0 2.87 0.00 0.28 0.02 0.08 96.75 06:17:09 06:07:01 1 3.07 0.00 0.28 0.00 0.07 96.58 06:17:09 06:07:01 2 3.09 0.00 0.27 0.02 0.08 96.55 06:17:09 06:07:01 3 3.35 0.00 0.32 0.00 0.08 96.25 06:17:09 06:08:01 all 2.22 0.00 0.28 0.02 0.08 97.40 06:17:09 06:08:01 0 2.15 0.00 0.25 0.02 0.08 97.50 06:17:09 06:08:01 1 2.29 0.00 0.32 0.00 0.08 97.31 06:17:09 06:08:01 2 1.96 0.00 0.22 0.05 0.07 97.71 06:17:09 06:08:01 3 2.47 0.00 0.33 0.00 0.10 97.09 06:17:09 06:17:09 06:08:01 CPU %user %nice %system %iowait %steal %idle 06:17:09 06:09:01 all 30.19 0.00 1.15 0.03 0.10 68.53 06:17:09 06:09:01 0 31.76 0.00 1.02 0.03 0.10 67.08 06:17:09 06:09:01 1 32.18 0.00 1.46 0.05 0.12 66.20 06:17:09 06:09:01 2 28.17 0.00 0.96 0.00 0.08 70.79 06:17:09 06:09:01 3 28.69 0.00 1.17 0.02 0.12 70.01 06:17:09 06:10:02 all 35.51 0.00 1.14 0.30 0.10 62.97 06:17:09 06:10:02 0 32.53 0.00 1.20 0.03 0.10 66.13 06:17:09 06:10:02 1 36.95 0.00 1.05 0.48 0.10 61.41 06:17:09 06:10:02 2 34.52 0.00 1.20 0.00 0.10 64.18 06:17:09 06:10:02 3 38.01 0.00 1.08 0.67 0.08 60.15 06:17:09 06:11:01 all 7.07 0.00 0.42 0.06 0.09 92.37 06:17:09 06:11:01 0 7.15 0.00 0.51 0.02 0.08 92.23 06:17:09 06:11:01 1 7.22 0.00 0.30 0.00 0.08 92.40 06:17:09 06:11:01 2 7.12 0.00 0.46 0.00 0.10 92.32 06:17:09 06:11:01 3 6.77 0.00 0.41 0.20 0.08 92.54 06:17:09 06:12:01 all 6.20 0.00 0.43 0.02 0.10 93.26 06:17:09 06:12:01 0 6.26 0.00 0.45 0.03 0.08 93.17 06:17:09 06:12:01 1 6.40 0.00 0.45 0.00 0.10 93.05 06:17:09 06:12:01 2 5.84 0.00 0.37 0.00 0.08 93.71 06:17:09 06:12:01 3 6.28 0.00 0.45 0.03 0.12 93.12 06:17:09 06:13:01 all 5.21 0.00 0.46 0.01 0.08 94.23 06:17:09 06:13:01 0 5.53 0.00 0.37 0.02 0.08 94.01 06:17:09 06:13:01 1 5.14 0.00 0.44 0.00 0.08 94.34 06:17:09 06:13:01 2 5.09 0.00 0.45 0.00 0.07 94.39 06:17:09 06:13:01 3 5.09 0.00 0.60 0.03 0.08 94.19 06:17:09 06:14:01 all 0.46 0.00 0.25 0.03 0.06 99.20 06:17:09 06:14:01 0 0.72 0.00 0.38 0.05 0.07 98.78 06:17:09 06:14:01 1 0.38 0.00 0.23 0.02 0.07 99.30 06:17:09 06:14:01 2 0.37 0.00 0.10 0.02 0.05 99.47 06:17:09 06:14:01 3 0.38 0.00 0.28 0.02 0.07 99.25 06:17:09 06:15:01 all 0.49 0.00 0.20 0.01 0.07 99.23 06:17:09 06:15:01 0 0.77 0.00 0.42 0.02 0.08 98.72 06:17:09 06:15:01 1 0.27 0.00 0.07 0.00 0.07 99.60 06:17:09 06:15:01 2 0.62 0.00 0.18 0.00 0.07 99.13 06:17:09 06:15:01 3 0.30 0.00 0.13 0.03 0.07 99.47 06:17:09 06:16:01 all 2.01 0.00 0.46 0.15 0.08 97.30 06:17:09 06:16:01 0 4.10 0.00 0.52 0.28 0.08 95.02 06:17:09 06:16:01 1 0.65 0.00 0.57 0.00 0.10 98.68 06:17:09 06:16:01 2 2.28 0.00 0.27 0.00 0.07 97.38 06:17:09 06:16:01 3 0.99 0.00 0.48 0.32 0.08 98.13 06:17:09 06:17:01 all 27.58 0.00 1.64 1.35 0.08 69.35 06:17:09 06:17:01 0 28.37 0.00 1.93 1.46 0.08 68.16 06:17:09 06:17:01 1 17.33 0.00 1.11 3.02 0.08 78.46 06:17:09 06:17:01 2 31.89 0.00 1.89 0.63 0.10 65.49 06:17:09 06:17:01 3 32.69 0.00 1.62 0.28 0.07 65.34 06:17:09 Average: all 21.39 0.23 1.13 0.53 0.10 76.62 06:17:09 Average: 0 21.15 0.22 1.11 0.51 0.09 76.91 06:17:09 Average: 1 20.93 0.26 1.16 0.56 0.09 77.00 06:17:09 Average: 2 22.38 0.20 1.13 0.48 0.09 75.71 06:17:09 Average: 3 21.08 0.24 1.14 0.58 0.10 76.86 06:17:09 06:17:09 06:17:09