Skip to content

Commit

Permalink
Merge pull request #579 from oalbrigt/fence_aws-dont-fail-ci
Browse files Browse the repository at this point in the history
fence_aws: fixes to not fail CI, and dont use boto3 buildreq on CI nodes where it's not installed
  • Loading branch information
oalbrigt authored May 13, 2024
2 parents f690c05 + ecc07de commit 2bd250f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ ACLOCAL_AMFLAGS = -I m4

SUBDIRS = lib agents doc systemd

if HAVE_BOTO3
HAVE_BOTO3 = 1
else
HAVE_BOTO3 = 0
endif

.PHONY: $(SUBDIRS)

agents: lib
Expand Down Expand Up @@ -77,6 +83,7 @@ $(SPEC): $(SPEC).in
alphatag="" && \
numcomm="" && \
ver="$(VERSION)" && \
boto3_br="$(HAVE_BOTO3)" && \
if echo $$ver | grep -q -- "-dirty$$"; then \
dirty="dirty" && \
echo VERSION IS DIRTY && \
Expand Down Expand Up @@ -113,6 +120,7 @@ $(SPEC): $(SPEC).in
-e "s#@rgmanager@#$(RGMANAGER)#g" \
-e "s#@linux-ha@#$(LINUX_HA)#g" \
-e "s#@compat-habindir@#$(COMPAT_HABINDIR)#g" \
-e "s#@boto3_br@#$$boto3_br#g" \
$< > $@-t; \
if [ -z "$$dirty" ]; then sed -i -e "s#%glo.*dirty.*##g" $@-t; fi; \
if [ -z "$$alphatag" ]; then sed -i -e "s#%glo.*alphatag.*##g" $@-t; fi; \
Expand Down
5 changes: 4 additions & 1 deletion agents/aws/fence_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ def main():
aws_access_key_id=access_key,
aws_secret_access_key=secret_key)
except Exception as e:
fail_usage("Failed: Unable to connect to AWS: " + str(e))
if not options.get("--action", "") in ["metadata", "manpage", "validate-all"]:
fail_usage("Failed: Unable to connect to AWS: " + str(e))
else:
pass

# Operate the fencing device
result = fence_action(conn, options, set_power_status, get_power_status, get_nodes_list)
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ AC_PYTHON_MODULE(pexpect, 1)
AC_PYTHON_MODULE(pycurl, 1)
AC_PYTHON_MODULE(requests, 1)

AC_PYTHON_MODULE(boto3)
AM_CONDITIONAL(HAVE_BOTO3, [test "x$HAVE_PYMOD_BOTO3" == xyes ])

if echo "$AGENTS_LIST" | grep -q amt_ws; then
AC_PYTHON_MODULE(pywsman)
if test "x${HAVE_PYMOD_PYWSMAN}" != xyes; then
Expand Down
13 changes: 6 additions & 7 deletions fence-agents.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ Group: System Environment/Base
URL: https://github.com/ClusterLabs/fence-agents
Source0: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2

%if 0%{?rhel} == 9
%ifarch ppc64le s390x
%define rhel9_ppc64le_s390x 1
%endif
%endif
%define boto3_br @boto3_br@

# skipped: pve, raritan, rcd-serial, virsh
%global allfenceagents %(cat <<EOF
Expand Down Expand Up @@ -124,11 +120,14 @@ BuildRequires: python3-suds
%endif
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
BuildRequires: openwsman-python3
%if ! %{defined rhel9_ppc64le_s390x}
%if %{boto3_br}
BuildRequires: python3-boto3
%endif
%else
BuildRequires: python3-openwsman python3-boto3
BuildRequires: python3-openwsman
%if %{boto3_br}
BuildRequires: python3-boto3
%endif
%endif

# fence-virt
Expand Down

0 comments on commit 2bd250f

Please sign in to comment.