AzureStorageDownloader.py: Try importing azure.storage and install if necessary

This commit is contained in:
Marco Rossi 2017-11-06 13:36:58 -05:00
Родитель dd45471953
Коммит 6333f7ba77
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -1,6 +1,14 @@
from azure.storage.blob import BlockBlobService
import pickle, os, time, sys, datetime, requests, argparse
import configparser
try:
from azure.storage.blob import BlockBlobService
except ImportError as e:
print('ImportError: {}'.format(e))
if input("azure.storage.blob is required. Do you want to install it [Y/n]? ") != 'Y':
sys.exit()
import pip
pip.main(['install', 'azure.storage.blob'])
LogDownloaderURL = "https://cps-staging-exp-experimentation.azurewebsites.net/api/Log?account={ACCOUNT_NAME}&key={ACCOUNT_KEY}&start={START_DATE}&end={END_DATE}&container={CONTAINER}"