Commit d692ffe1 authored by Yuan Gao's avatar Yuan Gao
Browse files

Fixes the mount issue with full DNS name in the AWS China Regions; Upgrades...

Fixes the mount issue with full DNS name in the AWS China Regions; Upgrades unit test coverage version dependency to enable accurate python3.8 coverage test
parent cfd6a546
[![CircleCI](https://circleci.com/gh/aws/efs-utils.svg?style=svg)](https://circleci.com/gh/aws/efs-utils)
# efs-utils # efs-utils
Utilities for Amazon Elastic File System (EFS) Utilities for Amazon Elastic File System (EFS)
......
...@@ -11,7 +11,7 @@ set -ex ...@@ -11,7 +11,7 @@ set -ex
BASE_DIR=$(pwd) BASE_DIR=$(pwd)
BUILD_ROOT=${BASE_DIR}/build/debbuild BUILD_ROOT=${BASE_DIR}/build/debbuild
VERSION=1.19 VERSION=1.20
echo 'Cleaning deb build workspace' echo 'Cleaning deb build workspace'
rm -rf ${BUILD_ROOT} rm -rf ${BUILD_ROOT}
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
# #
[global] [global]
version=1.19 version=1.20
Package: amazon-efs-utils Package: amazon-efs-utils
Architecture: all Architecture: all
Version: 1.19 Version: 1.20
Section: utils Section: utils
Depends: python|python2, nfs-common, stunnel4 (>= 4.56) Depends: python|python2, nfs-common, stunnel4 (>= 4.56)
Priority: optional Priority: optional
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
%endif %endif
Name : amazon-efs-utils Name : amazon-efs-utils
Version : 1.19 Version : 1.20
Release : 1%{?dist} Release : 1%{?dist}
Summary : This package provides utilities for simplifying the use of EFS file systems Summary : This package provides utilities for simplifying the use of EFS file systems
......
attrs==17.4.0 attrs==17.4.0
configparser==3.5.0 configparser==3.5.0
coverage==4.5 coverage==4.5.4
enum34==1.1.6 enum34==1.1.6
flake8==3.7.9 flake8==3.7.9
funcsigs==1.0.2 funcsigs==1.0.2
......
...@@ -68,7 +68,7 @@ except ImportError: ...@@ -68,7 +68,7 @@ except ImportError:
from urllib.error import URLError from urllib.error import URLError
from urllib.request import urlopen from urllib.request import urlopen
VERSION = '1.19' VERSION = '1.20'
SERVICE = 'elasticfilesystem' SERVICE = 'elasticfilesystem'
CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf' CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf'
...@@ -130,7 +130,7 @@ SIGNED_HEADERS = ';'.join(CANONICAL_HEADERS_DICT.keys()) ...@@ -130,7 +130,7 @@ SIGNED_HEADERS = ';'.join(CANONICAL_HEADERS_DICT.keys())
REQUEST_PAYLOAD = '' REQUEST_PAYLOAD = ''
FS_ID_RE = re.compile('^(?P<fs_id>fs-[0-9a-f]+)$') FS_ID_RE = re.compile('^(?P<fs_id>fs-[0-9a-f]+)$')
EFS_FQDN_RE = re.compile(r'^(?P<fs_id>fs-[0-9a-f]+)\.efs\.(?P<region>[a-z0-9-]+)\.amazonaws.com$') EFS_FQDN_RE = re.compile(r'^(?P<fs_id>fs-[0-9a-f]+)\.efs\.(?P<region>[a-z0-9-]+)\.(?P<dns_name_suffix>[a-z0-9.]+)$')
AP_ID_RE = re.compile('^fsap-[0-9a-f]{17}$') AP_ID_RE = re.compile('^fsap-[0-9a-f]{17}$')
INSTANCE_METADATA_SERVICE_URL = 'http://169.254.169.254/latest/dynamic/instance-identity/document/' INSTANCE_METADATA_SERVICE_URL = 'http://169.254.169.254/latest/dynamic/instance-identity/document/'
......
...@@ -46,7 +46,7 @@ except ImportError: ...@@ -46,7 +46,7 @@ except ImportError:
from urllib.error import URLError from urllib.error import URLError
from urllib.request import urlopen from urllib.request import urlopen
VERSION = '1.19' VERSION = '1.20'
SERVICE = 'elasticfilesystem' SERVICE = 'elasticfilesystem'
CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf' CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf'
......
No preview for this file type
...@@ -33,6 +33,16 @@ def test_match_device_correct_descriptors_fs_id(mocker): ...@@ -33,6 +33,16 @@ def test_match_device_correct_descriptors_fs_id(mocker):
assert (fs_id, path) == mount_efs.match_device(None, device) assert (fs_id, path) == mount_efs.match_device(None, device)
def test_match_device_correct_descriptors_cname_dns_suffix_override_region(mocker):
get_dns_name_mock = mocker.patch('mount_efs.get_dns_name', return_value='fs-deadbeef.efs.cn-north-1.amazonaws.com.cn')
gethostbyname_ex_mock = mocker.patch('socket.gethostbyname_ex',
return_value=('fs-deadbeef.efs.cn-north-1.amazonaws.com.cn', [], None))
for device, (fs_id, path) in CORRECT_DEVICE_DESCRIPTORS_CNAME_DNS:
assert (fs_id, path) == mount_efs.match_device(None, device)
utils.assert_called(get_dns_name_mock)
utils.assert_called(gethostbyname_ex_mock)
def test_match_device_correct_descriptors_cname_dns_primary(mocker): def test_match_device_correct_descriptors_cname_dns_primary(mocker):
get_dns_name_mock = mocker.patch('mount_efs.get_dns_name', return_value='fs-deadbeef.efs.us-east-1.amazonaws.com') get_dns_name_mock = mocker.patch('mount_efs.get_dns_name', return_value='fs-deadbeef.efs.us-east-1.amazonaws.com')
gethostbyname_ex_mock = mocker.patch('socket.gethostbyname_ex', gethostbyname_ex_mock = mocker.patch('socket.gethostbyname_ex',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment