Skip to content

Commit

Permalink
Fix #253 (#255)
Browse files Browse the repository at this point in the history
* Fix #253

* Bump version
  • Loading branch information
blackchoey authored Dec 12, 2019
1 parent 68e68e8 commit 3bf2ccb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion iotedgehubdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
pkg_resources.declare_namespace(__name__)

__author__ = 'Microsoft Corporation'
__version__ = '0.13.0rc0'
__version__ = '0.13.0rc1'
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe'
__production__ = 'iotedgehubdev'
8 changes: 5 additions & 3 deletions iotedgehubdev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ def generatedeviceca(output_dir, valid_days, force, trusted_ca, trusted_ca_key,
# Check whether create new trusted CA and generate files to be created
output_files = list(Utils.get_device_ca_file_paths(output_dir, EdgeConstants.DEVICE_CA_ID).values())
if trusted_ca and trusted_ca_key:
output.info('Trusted CA and trusted CA key were provided. Load trusted CA from given files.')
output.info('Trusted CA (certification authority) and trusted CA key were provided.'
' Load trusted CA from given files.')
else:
output.info('Trusted CA and Trusted CA key were not provided. Will create new trusted CA.')
output.info('Trusted CA (certification authority) and Trusted CA key were not provided.'
' Will create new trusted CA.')
root_ca_files = Utils.get_device_ca_file_paths(output_dir, EdgeConstants.ROOT_CA_ID)
output_files.append(root_ca_files[EdgeConstants.CERT_SUFFIX])
output_files.append(root_ca_files[EdgeConstants.KEY_SUFFIX])
Expand All @@ -366,7 +368,7 @@ def generatedeviceca(output_dir, valid_days, force, trusted_ca, trusted_ca_key,
# Generate certs
edgeCert = EdgeCert(output_dir, '')
edgeCert.generate_device_ca(valid_days, force, trusted_ca, trusted_ca_key, trusted_ca_key_passphase)
output.info('Successfully generated device ca. Please find the generated certs at %s' % output_dir)
output.info('Successfully generated device CA. Please find the generated certs at %s' % output_dir)
except Exception as e:
raise e

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from setuptools import find_packages, setup

VERSION = '0.13.0rc0'
VERSION = '0.13.0rc1'
# If we have source, validate that our version numbers match
# This should prevent uploading releases with mismatched versions.
try:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def test_cli_generate_device_ca(runner):
os.makedirs(test_temp_cert_dir)
try:
result = runner.invoke(cli.generatedeviceca, ['-o', test_temp_cert_dir])
assert 'Successfully generated device ca. Please find the generated certs at %s' % test_temp_cert_dir in result.output
assert 'Successfully generated device CA. Please find the generated certs at %s' % test_temp_cert_dir in result.output
assert os.path.exists(os.path.join(test_temp_cert_dir, 'certs', 'azure-iot-test-only.root.ca.cert.pem'))
assert os.path.exists(os.path.join(test_temp_cert_dir, 'certs', 'azure-iot-test-only.root.ca.key.pem'))
assert os.path.exists(os.path.join(test_temp_cert_dir, 'certs', 'iot-edge-device-ca.cert.pem'))
Expand All @@ -528,7 +528,7 @@ def test_cli_generate_device_ca(runner):
assert 'iot-edge-device-ca.cert.pem' in result.output
assert 'iot-edge-device-ca.key.pem' in result.output
assert 'iot-edge-device-ca-chain.cert.pem' in result.output
assert 'Successfully generated device ca. Please find the generated certs at %s' % test_temp_cert_dir in result.output
assert 'Successfully generated device CA. Please find the generated certs at %s' % test_temp_cert_dir in result.output
finally:
shutil.rmtree(test_temp_cert_dir, ignore_errors=True)

Expand All @@ -543,7 +543,7 @@ def test_cli_generate_device_ca_with_given_ca(runner):
'--trusted-ca', trusted_ca_file,
'--trusted-ca-key', trusted_ca_key_file,
'--trusted-ca-key-passphase', VALID_TEST_CA_KEY_PASSPHASE])
assert 'Successfully generated device ca. '
assert 'Successfully generated device CA. '
'Please find the generated certs at %s' % test_temp_cert_dir in result.output, 'The root ca '
'expires on November 28, 2022. Please check whether it expires first when test case failed.'
assert not os.path.exists(os.path.join(test_temp_cert_dir, 'certs', 'azure-iot-test-only.root.ca.cert.pem'))
Expand Down

0 comments on commit 3bf2ccb

Please sign in to comment.