diff --git a/client-cli/pvc/lib/provisioner.py b/client-cli/pvc/lib/provisioner.py index 41dbb2e9..1f6c537e 100644 --- a/client-cli/pvc/lib/provisioner.py +++ b/client-cli/pvc/lib/provisioner.py @@ -19,11 +19,6 @@ # ############################################################################### -from requests_toolbelt.multipart.encoder import ( - MultipartEncoder, - MultipartEncoderMonitor, -) - import pvc.lib.ansiprint as ansiprint from pvc.lib.common import UploadProgressBar, call_api, get_wait_retdata @@ -549,6 +544,12 @@ def ova_upload(config, name, ova_file, params): bar = UploadProgressBar( ova_file, end_message="Parsing file on remote side...", end_nl=False ) + + from requests_toolbelt.multipart.encoder import ( + MultipartEncoder, + MultipartEncoderMonitor, + ) + upload_data = MultipartEncoder( fields={"file": ("filename", open(ova_file, "rb"), "application/octet-stream")} ) diff --git a/client-cli/pvc/lib/storage.py b/client-cli/pvc/lib/storage.py index 2d3b0be4..42680c7f 100644 --- a/client-cli/pvc/lib/storage.py +++ b/client-cli/pvc/lib/storage.py @@ -23,10 +23,6 @@ import math from os import path from json import loads -from requests_toolbelt.multipart.encoder import ( - MultipartEncoder, - MultipartEncoderMonitor, -) import pvc.lib.ansiprint as ansiprint from pvc.lib.common import UploadProgressBar, call_api, get_wait_retdata @@ -1212,6 +1208,12 @@ def ceph_volume_upload(config, pool, volume, image_format, image_file): bar = UploadProgressBar( image_file, end_message="Parsing file on remote side...", end_nl=False ) + + from requests_toolbelt.multipart.encoder import ( + MultipartEncoder, + MultipartEncoderMonitor, + ) + upload_data = MultipartEncoder( fields={ "file": ("filename", open(image_file, "rb"), "application/octet-stream")