Merge pull request #9 from davidkydd/master

Catch NoOptionError when loading config, fix typo
This commit is contained in:
davidkydd 2017-09-07 14:34:18 +12:00 коммит произвёл GitHub
Родитель ad9ea292b0 2b53bac802
Коммит 05bc4a5176
2 изменённых файлов: 5 добавлений и 5 удалений

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

@ -35,7 +35,7 @@ REQUIREMENTS = [
"pathlib==1.0.1",
]
NAMESPACE_PACAKGES = [
NAMESPACE_PACKAGES = [
"azure-mgmt-batch==4.0.0",
"azure-mgmt-storage==1.0.0",
"azure-common==1.1.5",
@ -413,7 +413,7 @@ def initializePlugin(obj):
for package in REQUIREMENTS:
if not dependency_installed(package):
missing_libs.append(package)
for package in NAMESPACE_PACAKGES:
for package in NAMESPACE_PACKAGES:
if not dependency_installed(package):
missing_libs.append(package)
if missing_libs:
@ -446,7 +446,7 @@ def initializePlugin(obj):
print("Installing dependencies")
for package in missing_libs:
install_pkg(package)
if package in NAMESPACE_PACAKGES:
if package in NAMESPACE_PACKAGES:
package_path = package.split('==')[0].split('-')
install_namespace_pkg(package, os.path.join(*package_path))
except:

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

@ -146,10 +146,10 @@ def _authenticate(cfg_path):
endpoint_suffix="core.windows.net")
try:
concurrent_downloads = cfg.get("AzureBatch", "threads")
except ConfigParser.NoSectionError:
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as exp:
concurrent_downloads = 20
except (EnvironmentError, ConfigParser.NoOptionError, ConfigParser.NoSectionError) as exp:
raise ValueError("Failed to authenticate using Maya configuration {0}".format(cfg_path))
raise ValueError("Failed to authenticate using Maya configuration {0}, Exception: {1}".format(cfg_path, exp))
if __name__ == "__main__":