diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec2875..d422466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ [![PyPI version](https://badge.fury.io/py/iotedgehubdev.svg)](https://badge.fury.io/py/iotedgehubdev) -## 0.14.11 - 2022-03-01 +## 0.14.13 - 2022-03-16 +* Update regex match module + +## 0.14.12 - 2022-03-01 * Update Python support to 3.9 ## 0.14.11 - 2022-02-10 diff --git a/iotedgehubdev/__init__.py b/iotedgehubdev/__init__.py index 7499643..8acd494 100644 --- a/iotedgehubdev/__init__.py +++ b/iotedgehubdev/__init__.py @@ -7,6 +7,6 @@ pkg_resources.declare_namespace(__name__) __author__ = 'Microsoft Corporation' -__version__ = '0.14.12' +__version__ = '0.14.13' __AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe' __production__ = 'iotedgehubdev' diff --git a/iotedgehubdev/compose_parser.py b/iotedgehubdev/compose_parser.py index 34a1701..e69a213 100644 --- a/iotedgehubdev/compose_parser.py +++ b/iotedgehubdev/compose_parser.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. import os -import re +import regex from jsonpath_rw import parse @@ -187,7 +187,7 @@ def service_parser_volumes(create_options_details): # Binds should be in the format [source:]destination[:mode] # Windows format and LCOW format are more strict than Linux format due to colons in Windows paths, # so match with them first - match = re.match(EdgeConstants.MOUNT_WIN_REGEX, bind) or re.match(EdgeConstants.MOUNT_LCOW_REGEX, bind) + match = regex.match(EdgeConstants.MOUNT_WIN_REGEX, bind) or regex.match(EdgeConstants.MOUNT_LCOW_REGEX, bind) if match is not None: source = match.group('source') or '' target = match.group('destination') diff --git a/requirements.txt b/requirements.txt index 87d6871..918261c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,4 @@ docker-compose==1.29.1 pytest pyinstaller==4.2 urllib3>=1.26.4 +regex diff --git a/setup.py b/setup.py index 4bb623a..f39a89d 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ """ from setuptools import find_packages, setup -VERSION = '0.14.12' +VERSION = '0.14.13' # If we have source, validate that our version numbers match # This should prevent uploading releases with mismatched versions. try: diff --git a/tests/test_cli.py b/tests/test_cli.py index 91a6b67..9970d54 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -480,8 +480,10 @@ def test_cli_start_with_create_options_for_bind(runner): shutil.copy(deployment_json_file_path, config_file_path) if get_docker_os_type() == "windows": - update_file_content(config_file_path, '/usr:/home/moduleuser/test', - r'C:\\\\\\\\Users:C:/moduleuser/test') + update_file_content(config_file_path, '/usr:/home/moduleuser/usr', + r'C:\\\\\\\\Windows\\\\\\\\System32:C:/moduleuser/System32') + update_file_content(config_file_path, '/run:/home/moduleuser/run', + r'C:\\\\\\\\Windows\\\\\\\\System:C:/moduleuser/System') cli_setup(runner) cli_start_with_deployment(runner, config_file_path) @@ -489,9 +491,11 @@ def test_cli_start_with_create_options_for_bind(runner): wait_verify_docker_output(['docker', 'logs', 'edgeHubDev'], ['Opened link']) wait_verify_docker_output(['docker', 'logs', 'tempSensor'], ['Sending message']) if get_docker_os_type() == "windows": - wait_verify_docker_output('echo dir | docker exec -i -w c:/moduleuser/test/ tempSensor cmd', ['Public'], True) + wait_verify_docker_output('echo dir | docker exec -i -w c:/moduleuser/System32/ tempSensor cmd', ['Public'], True) + wait_verify_docker_output('echo dir | docker exec -i -w c:/moduleuser/System/ tempSensor cmd', ['Public'], True) else: - wait_verify_docker_output(['docker', 'exec', 'tempSensor', 'ls', '/home/moduleuser/test'], ["share"]) + wait_verify_docker_output(['docker', 'exec', 'tempSensor', 'ls', '/home/moduleuser/usr'], ["share"]) + wait_verify_docker_output(['docker', 'exec', 'tempSensor', 'ls', '/home/moduleuser/run'], ["docker"]) finally: shutil.rmtree(temp_config_folder, ignore_errors=True) result = cli_stop(runner) diff --git a/tests/test_compose_resources/deployment_with_create_options_for_bind.json b/tests/test_compose_resources/deployment_with_create_options_for_bind.json index 4410a81..3b1df15 100644 --- a/tests/test_compose_resources/deployment_with_create_options_for_bind.json +++ b/tests/test_compose_resources/deployment_with_create_options_for_bind.json @@ -41,7 +41,7 @@ "restartPolicy": "always", "settings": { "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0", - "createOptions": "{\"HostConfig\":{\"Binds\":[\"/usr:/home/moduleuser/test\"]}}" + "createOptions": "{\"HostConfig\":{\"Binds\":[\"/usr:/home/moduleuser/usr\",\"/run:/home/moduleuser/run\"]}}" } } }