Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Neil Hanlon
Efs Utils
Commits
20ebbdf5
Commit
20ebbdf5
authored
Apr 08, 2020
by
Yuan Gao
Browse files
Fix the malformed certificate info
parent
2c2887cb
Changes
5
Hide whitespace changes
Inline
Side-by-side
.circleci/config.yml
View file @
20ebbdf5
...
...
@@ -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
config.ini
View file @
20ebbdf5
...
...
@@ -8,4 +8,4 @@
[global]
version
=
1.24
release
=
3
release
=
4
dist/amazon-efs-utils.spec
View file @
20ebbdf5
...
...
@@ -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
...
...
src/mount_efs/__init__.py
View file @
20ebbdf5
...
...
@@ -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
.
warn
ing
(
'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
.
warn
ing
(
'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
...
...
test/global_test/test_global_version_match.py
View file @
20ebbdf5
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment