Skip to content

Commit 8674927

Browse files
committed
Merge pull request Azure#378 from crwilcox/issue_376
Fixes Azure#376 by making pyopenssl optional
2 parents 43a9ee3 + 09fa065 commit 8674927

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

azure.pyproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
<Content Include="ChangeLog.txt" />
105105
<Content Include="LICENSE.txt" />
106106
<Content Include="README.rst" />
107+
<Content Include="optional-requirements.txt" />
107108
<Content Include="requirements.txt" />
108109
<Content Include="tests\azurecredentials_sample.json" />
109110
<Content Include="tests\coverage.bat" />

azure/servicemanagement/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,11 @@ def get_certificate_from_publish_settings(publish_settings_path, path_to_write_c
19941994
specific subscription under the publish settings file.
19951995
'''
19961996
import base64
1997-
import OpenSSL.crypto as crypto
1997+
1998+
try:
1999+
import OpenSSL.crypto as crypto
2000+
except:
2001+
raise Exception("pyopenssl is required to use get_certificate_from_publish_settings")
19982002

19992003
_validate_not_none('publish_settings_path', publish_settings_path)
20002004
_validate_not_none('path_to_write_certificate', path_to_write_certificate)

optional-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyopenssl

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
futures
22
python-dateutil
3-
pyopenssl
43
requests

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
'azure.storage',
5353
'azure.servicemanagement'],
5454
install_requires=['python-dateutil',
55-
'pyopenssl',
56-
'futures']
57-
)
55+
'futures'],
56+
extras_require = {
57+
'get_certificate_from_publish_settings' : ['pyopenssl']
58+
}
59+
)

0 commit comments

Comments
 (0)