try:
    connection = opener.open(request)
except urllib.error.HTTPError as e:
    connection = e
if connection.code == 200:
    data = connection.read()
print('Data :', data)
Аутентификация пользователя VCloud Director Org для Rest API в python