Commit 20ebbdf5 authored by Yuan Gao's avatar Yuan Gao
Browse files

Fix the malformed certificate info

parent 2c2887cb
......@@ -141,16 +141,4 @@ workflows:
image: amazonlinux:2
- build-rpm-package:
name: amazon-linux
image: amazonlinux:1
- build-rpm-package:
name: fedora30
image: fedora:30
- build-rpm-package:
name: fedora31
image: fedora:31
- build-rpm-package:
name: fedora32
image: fedora:32
- build-rpm-package:
name: fedora33
image: fedora:33
\ No newline at end of file
image: amazonlinux:1
\ No newline at end of file
......@@ -8,4 +8,4 @@
[global]
version=1.24
release=3
release=4
......@@ -21,7 +21,7 @@
Name : amazon-efs-utils
Version : 1.24
Release : 3%{?dist}
Release : 4%{?dist}
Summary : This package provides utilities for simplifying the use of EFS file systems
Group : Amazon/Tools
......@@ -120,6 +120,9 @@ fi
%clean
%changelog
* Tue Apr 7 2020 Yuan Gao <ygaochn@amazon.com> - 1.24-4
- Fix the malformed certificate info
* Fri Mar 27 2020 Yuan Gao <ygaochn@amazon.com> - 1.24-3
- Use IMDSv1 by default, and use IMDSv2 where required
......
......@@ -223,8 +223,8 @@ def get_target_region(config):
return get_region_from_instance_metadata()
except Exception as e:
metadata_exception = e
logging.warn('Region not found in config file and metadata service call failed, falling back '
'to legacy "dns_name_format" check')
logging.warning('Region not found in config file and metadata service call failed, falling back '
'to legacy "dns_name_format" check')
try:
region = get_region_from_legacy_dns_format(config)
......@@ -232,7 +232,7 @@ def get_target_region(config):
'parameter in the efs-utils configuration file.')
return region
except Exception:
logging.warn('Legacy check for region in "dns_name_format" failed')
logging.warning('Legacy check for region in "dns_name_format" failed')
_fatal_error(metadata_exception)
......@@ -1112,7 +1112,7 @@ def efs_client_auth_builder(public_key_path, access_key_id, secret_access_key, d
def efs_client_info_builder(client_info):
efs_client_info_str = '[ efs_client_info ]'
for key, value in client_info.items():
efs_client_info_str += '\n%s = UTF8String: %s' % (key, value)
efs_client_info_str += '\n%s = UTF8String:%s' % (key, value)
return efs_client_info_str
......
......@@ -29,6 +29,14 @@ def test_global_version_match():
'version in {} is {}, does not match global version {}'.format(f, version_in_file, global_version)
def test_global_release_match():
global_release = get_global_value('release')
release_in_file = get_release_for_file(RPM_FILE)
assert release_in_file == global_release, \
'release in {} is {}, does not match global release {}'.format(RPM_FILE, release_in_file, global_release)
def test_changelog_version_match():
global_version = get_global_value('version')
global_release = get_global_value('release')
......@@ -67,6 +75,17 @@ def get_version_for_file(file_path):
return None
def get_release_for_file(file_path):
mount_helper_root_folder = uppath(os.path.abspath(__file__), 3)
file_to_check = os.path.join(mount_helper_root_folder, file_path)
with open(file_to_check) as fp:
lines = fp.readlines()
for line in lines:
if line.startswith('Release'):
return line.split(':')[1].strip().split('%')[0]
return None
def get_global_value(key):
mount_helper_root_folder = uppath(os.path.abspath(__file__), 3)
config_file = os.path.join(mount_helper_root_folder, GLOBAL_CONFIG)
......
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