From 464c9dd9b1ef957ba91ee22b9857f2b2de23124d Mon Sep 17 00:00:00 2001 From: ssamson-tis Date: Fri, 3 Jul 2015 16:18:00 +0200 Subject: [PATCH] fix compatibility with old python versions --- libtisbackup/backup_xva.py | 4 +++- libtisbackup/copy_vm_xcp.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libtisbackup/backup_xva.py b/libtisbackup/backup_xva.py index 4e0830b..f737726 100755 --- a/libtisbackup/backup_xva.py +++ b/libtisbackup/backup_xva.py @@ -35,7 +35,9 @@ import tarfile import hashlib from stat import * import ssl -ssl._create_default_https_context = ssl._create_unverified_context + +if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context class backup_xva(backup_generic): diff --git a/libtisbackup/copy_vm_xcp.py b/libtisbackup/copy_vm_xcp.py index 44e6c09..62806bb 100755 --- a/libtisbackup/copy_vm_xcp.py +++ b/libtisbackup/copy_vm_xcp.py @@ -34,7 +34,8 @@ import base64 import socket from stat import * import ssl -ssl._create_default_https_context = ssl._create_unverified_context +if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context class copy_vm_xcp(backup_generic):