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
6309b6ce
Commit
6309b6ce
authored
Aug 11, 2020
by
Yuan Gao
Browse files
Merge PR #60 on GitHub. Adds support for AssumeRoleWithWebIdentity.
parent
2696a77b
Changes
10
Hide whitespace changes
Inline
Side-by-side
.circleci/config.yml
View file @
6309b6ce
...
...
@@ -29,6 +29,8 @@ commands:
command
:
|
source ~/efs-utils-virtualenv/bin/activate
make test
-
store_artifacts
:
path
:
build
build-deb
:
steps
:
-
checkout
...
...
@@ -58,7 +60,7 @@ commands:
-
run
:
name
:
Install dependencies
command
:
|
yum -y install rpm-build make
yum -y install rpm-build make
systemd
-
run
:
name
:
Build RPM
command
:
|
...
...
.gitignore
View file @
6309b6ce
/amazon-efs-utils*
!amazon-efs-utils.spec
.coverage
.pytest_cache
...
...
Makefile
View file @
6309b6ce
...
...
@@ -17,7 +17,6 @@ clean:
rm
-rf
$(BUILD_DIR)
rm
-rf
$(PACKAGE_NAME)
rm
-f
$(SOURCE_TARBALL)
rm
-f
$(SPECFILE)
.PHONY
:
tarball
tarball
:
clean
...
...
@@ -38,13 +37,6 @@ tarball: clean
tar
-czf
$(SOURCE_TARBALL)
$(PACKAGE_NAME)/*
.PHONY
:
specfile
specfile
:
clean
ln
-sf
dist/
$(SPECFILE)
$(SPECFILE)
.PHONY
:
sources
sources
:
tarball specfile
.PHONY
:
shebang-support
shebang-support
:
./mangle-shebangs.sh
...
...
@@ -58,7 +50,7 @@ rpm-only:
cp
$(BUILD_DIR)
/RPMS/
*
/
*
rpm build
.PHONY
:
rpm
rpm
:
shebang-support
sources
rpm-only
rpm
:
shebang-support
tarball
rpm-only
.PHONY
:
deb
deb
:
...
...
dist/
amazon-efs-utils.spec
→
amazon-efs-utils.spec
View file @
6309b6ce
...
...
@@ -25,9 +25,15 @@
%global with_systemd 1
%endif
%if 0%{?is_opensuse}
%global platform .opensuse
%else
%global platform %{dist}
%endif
Name : amazon-efs-utils
Version : 1.2
6
Release :
3
%{
?dist
}
Version : 1.2
7.1
Release :
1
%{
platform
}
Summary : This package provides utilities for simplifying the use of EFS file systems
Group : Amazon/Tools
...
...
@@ -126,6 +132,9 @@ fi
%clean
%changelog
* Tue Aug 4 2020 Karthik Basavaraj <kbbasav@amazon.com> - 1.27.1
- Merge PR #60 on GitHub. Adds support for AssumeRoleWithWebIdentity
* Wed Jul 1 2020 Yuan Gao <ygaochn@amazon.com> - 1.26.3
- Fix an issue where watchdog crashed during restart because stunnel was killed and pid key was removed from state file
...
...
build-deb.sh
View file @
6309b6ce
...
...
@@ -11,7 +11,8 @@ set -ex
BASE_DIR
=
$(
pwd
)
BUILD_ROOT
=
${
BASE_DIR
}
/build/debbuild
VERSION
=
1.26.3
VERSION
=
1.27.1
RELEASE
=
1
DEB_SYSTEM_RELEASE_PATH
=
/etc/os-release
UBUNTU18_REGEX
=
"Ubuntu 18"
DEBIAN11_REGEX
=
"Debian GNU/Linux bullseye"
...
...
@@ -73,7 +74,7 @@ tar czf data.tar.gz etc sbin usr var --owner=0 --group=0
cd
${
BASE_DIR
}
echo
'Building deb'
DEB
=
${
BUILD_ROOT
}
/amazon-efs-utils-
${
VERSION
}
.deb
DEB
=
${
BUILD_ROOT
}
/amazon-efs-utils-
${
VERSION
}
-
${
RELEASE
}
.deb
ar r
${
DEB
}
${
BUILD_ROOT
}
/debian-binary
ar r
${
DEB
}
${
BUILD_ROOT
}
/control.tar.gz
ar r
${
DEB
}
${
BUILD_ROOT
}
/data.tar.gz
...
...
config.ini
View file @
6309b6ce
...
...
@@ -7,5 +7,5 @@
#
[global]
version
=
1.2
6
release
=
3
version
=
1.2
7.1
release
=
1
dist/amazon-efs-utils.control
View file @
6309b6ce
Package: amazon-efs-utils
Architecture: all
Version: 1.2
6.3
Version: 1.2
7.1
Section: utils
Depends: python|python2, nfs-common, stunnel4 (>= 4.56), openssl (>= 1.0.2), util-linux
Priority: optional
...
...
src/mount_efs/__init__.py
View file @
6309b6ce
...
...
@@ -70,7 +70,7 @@ except ImportError:
from
urllib.parse
import
urlencode
VERSION
=
'1.2
6.3
'
VERSION
=
'1.2
7.1
'
SERVICE
=
'elasticfilesystem'
CONFIG_FILE
=
'/etc/amazon/efs/efs-utils.conf'
...
...
@@ -1571,7 +1571,7 @@ def is_nfs_mount(mountpoint):
def
mount_tls
(
config
,
init_system
,
dns_name
,
path
,
fs_id
,
mountpoint
,
options
):
if
os
.
path
.
ismount
(
mountpoint
)
and
is_nfs_mount
(
mountpoint
):
sys
.
stdout
.
write
(
"%s is already mounted, please run 'mount' command to verify
\n
"
%
mountpoint
)
logging
.
warn
(
"%s is already mounted, mount aborted"
%
mountpoint
)
logging
.
warn
ing
(
"%s is already mounted, mount aborted"
%
mountpoint
)
return
with
bootstrap_tls
(
config
,
init_system
,
dns_name
,
fs_id
,
mountpoint
,
options
)
as
tunnel_proc
:
...
...
src/watchdog/__init__.py
View file @
6309b6ce
...
...
@@ -47,7 +47,7 @@ except ImportError:
from
urllib.request
import
urlopen
,
Request
from
urllib.parse
import
urlencode
VERSION
=
'1.2
6.3
'
VERSION
=
'1.2
7.1
'
SERVICE
=
'elasticfilesystem'
CONFIG_FILE
=
'/etc/amazon/efs/efs-utils.conf'
...
...
test/global_test/test_global_version_match.py
View file @
6309b6ce
...
...
@@ -14,45 +14,45 @@ except ImportError:
from
configparser
import
ConfigParser
SPEC_FILE
=
'dist/amazon-efs-utils.spec'
NON_SPEC_FILE_LIST
=
[
'build-deb.sh'
,
'src/watchdog/__init__.py'
,
'src/mount_efs/__init__.py'
,
'dist/amazon-efs-utils.control'
,
'build-deb.sh'
]
SPEC_FILE
=
'amazon-efs-utils.spec'
DEB_FILE
=
'build-deb.sh'
FILE_LIST
=
[
'build-deb.sh'
,
'src/watchdog/__init__.py'
,
'src/mount_efs/__init__.py'
,
'dist/amazon-efs-utils.control'
,
'build-deb.sh'
,
'amazon-efs-utils.spec'
]
GLOBAL_CONFIG
=
'config.ini'
def
test_spec_file_version_release_match
():
global_version
=
get_global_value
(
'version'
)
global_release
=
get_global_value
(
'release'
)
version_in_spec_file
=
get_version_for_file
(
SPEC_FILE
)
release_in_spec_file
=
get_release_for_file
(
SPEC_FILE
)
assert
version_in_spec_file
==
global_version
,
\
'version in {} is {}, does not match global version {}'
.
format
(
SPEC_FILE
,
version_in_spec_file
,
global_version
)
assert
release_in_spec_file
==
global_release
,
\
'release in {} is {}, does not match global release {}'
.
format
(
SPEC_FILE
,
release_in_spec_file
,
global_release
)
def
test_file_version_match
():
global_version
=
get_global_version
()
for
f
in
FILE_LIST
:
version_in_file
=
get_version_for_file
(
f
)
assert
version_in_file
==
global_version
,
'version in {} is {}, does not match global version {}'
\
.
format
(
f
,
version_in_file
,
global_version
)
def
test_
non_spec_file_version
_release_match
():
global_
version_
release
=
get_
expected_version
_release
()
for
f
in
NON_
SPEC_FILE
_LIST
:
version_
release_in_file
=
get_
version
_for_file
(
f
)
assert
version_
release_in_file
==
global_
version_
release
,
'
version-
release in {} is {}, does not match global
version
{}'
\
.
format
(
f
,
version_
release_in_file
,
global_
version_
release
)
def
test_
file
_release_match
():
global_release
=
get_
global
_release
()
for
f
in
[
DEB_FILE
,
SPEC_FILE
]
:
release_in_file
=
get_
release
_for_file
(
f
)
assert
release_in_file
==
global_release
,
'release in {} is {}, does not match global
release
{}'
\
.
format
(
f
,
release_in_file
,
global_release
)
def
test_changelog_version_match
():
expected_version_release
=
get_expected_version_release
()
global_version
=
get_global_version
()
version_
release_
in_changelog
=
get_version_for_changelog
(
SPEC_FILE
)
assert
version_
release_
in_changelog
is
not
None
and
version_
release_
in_changelog
==
expected_version_release
,
\
version_in_changelog
=
get_version_for_changelog
(
SPEC_FILE
)
assert
version_in_changelog
is
not
None
and
version_in_changelog
==
global_version
,
\
'version in {} is {}, does not match expected_version_release {}, you need to add changelog in the spec file'
\
.
format
(
SPEC_FILE
,
version_
release_
in_changelog
,
expected_version_release
)
.
format
(
SPEC_FILE
,
version_in_changelog
,
global_version
)
def
get_expected_version_release
():
global_version
=
get_global_value
(
'version'
)
global_release
=
get_global_value
(
'release'
)
return
global_version
+
'.'
+
global_release
def
get_global_version
():
return
get_global_value
(
'version'
)
def
get_global_release
():
return
get_global_value
(
'release'
)
def
get_version_for_changelog
(
file_path
):
...
...
@@ -88,6 +88,8 @@ def get_release_for_file(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
()
if
line
.
startswith
(
'Release'
):
return
line
.
split
(
':'
)[
1
].
strip
().
split
(
'%'
)[
0
]
return
None
...
...
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