Skip to content

Commit 339fa06

Browse files
authored
Autoformat: ruff, shfmt, dockerfmt, yamlfmt (#140)
1 parent 7233c70 commit 339fa06

29 files changed

+885
-690
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*~
2+
.*.sw[po]
23
__pycache__/
34
*.py[cod]

dockerfiles/microservices-dependencies.dockerfile

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,42 @@ ARG KAFKAOPMONVERSION=v2.0.0 # For OpMonSubscriber.py from kafkaopmon
88
ARG LOCALPYDIR=/microservices_python
99

1010
RUN yum clean all \
11-
&& yum -y install gcc make git unzip libpq-devel libffi-devel python3-pip python3-wheel krb5-devel python3-devel \
12-
&& yum clean all
11+
&& yum -y install gcc make git unzip libpq-devel libffi-devel python3-pip python3-wheel krb5-devel python3-devel \
12+
&& yum clean all
1313

1414
# Can drop when migration to sqlalchemy is complete since we're using the thin client there
15-
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm && \
16-
yum -y install libaio libnsl && \
17-
rpm -iv oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm
15+
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm \
16+
&& yum -y install libaio libnsl \
17+
&& rpm -iv oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm
1818

1919
COPY requirements.txt /
20-
RUN python3 -m pip install --upgrade setuptools && \
21-
python3 -m pip install -r requirements.txt && \
22-
python3 -m pip cache remove \*
20+
RUN python3 -m pip install --upgrade setuptools \
21+
&& python3 -m pip install -r requirements.txt \
22+
&& python3 -m pip cache remove \*
2323

2424
# elisa_client_api needed by the logbook microservice
25-
RUN git clone https://github.com/DUNE-DAQ/elisa_client_api.git && \
26-
python3 -m pip install --upgrade setuptools && \
27-
python3 -m pip install ./elisa_client_api
25+
RUN git clone https://github.com/DUNE-DAQ/elisa_client_api.git \
26+
&& python3 -m pip install --upgrade setuptools \
27+
&& python3 -m pip install ./elisa_client_api
2828

2929
# protoc-24.3-linux-x86_64.zip is the latest zipfile available as of Sep-15-2023
3030
# See also https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os
3131

32-
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip && \
33-
unzip protoc-24.3-linux-x86_64.zip && \
34-
curl -O https://raw.githubusercontent.com/DUNE-DAQ/ers/$ERSVERSION/schema/ers/issue.proto && \
35-
mkdir -p $LOCALPYDIR/ers && \
36-
protoc --python_out=$LOCALPYDIR/ers issue.proto && \
37-
curl -O https://raw.githubusercontent.com/DUNE-DAQ/opmonlib/$OPMONLIBVERSION/schema/opmonlib/opmon_entry.proto && \
38-
mkdir -p $LOCALPYDIR/opmonlib && \
39-
protoc --python_out=$LOCALPYDIR/opmonlib -I/ -I/include opmon_entry.proto
32+
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip \
33+
&& unzip protoc-24.3-linux-x86_64.zip \
34+
&& curl -O https://raw.githubusercontent.com/DUNE-DAQ/ers/$ERSVERSION/schema/ers/issue.proto \
35+
&& mkdir -p $LOCALPYDIR/ers \
36+
&& protoc --python_out=$LOCALPYDIR/ers issue.proto \
37+
&& curl -O https://raw.githubusercontent.com/DUNE-DAQ/opmonlib/$OPMONLIBVERSION/schema/opmonlib/opmon_entry.proto \
38+
&& mkdir -p $LOCALPYDIR/opmonlib \
39+
&& protoc --python_out=$LOCALPYDIR/opmonlib -I/ -I/include opmon_entry.proto
4040

41-
RUN mkdir -p $LOCALPYDIR/erskafka && \
42-
curl https://raw.githubusercontent.com/DUNE-DAQ/erskafka/$ERSKAFKAVERSION/python/erskafka/ERSSubscriber.py -o $LOCALPYDIR/erskafka/ERSSubscriber.py && \
43-
mkdir -p $LOCALPYDIR/kafkaopmon && \
44-
curl https://raw.githubusercontent.com/DUNE-DAQ/kafkaopmon/$KAFKAOPMONVERSION/python/kafkaopmon/OpMonSubscriber.py -o $LOCALPYDIR/kafkaopmon/OpMonSubscriber.py
41+
RUN mkdir -p $LOCALPYDIR/erskafka \
42+
&& curl https://raw.githubusercontent.com/DUNE-DAQ/erskafka/$ERSKAFKAVERSION/python/erskafka/ERSSubscriber.py -o $LOCALPYDIR/erskafka/ERSSubscriber.py \
43+
&& mkdir -p $LOCALPYDIR/kafkaopmon \
44+
&& curl https://raw.githubusercontent.com/DUNE-DAQ/kafkaopmon/$KAFKAOPMONVERSION/python/kafkaopmon/OpMonSubscriber.py -o $LOCALPYDIR/kafkaopmon/OpMonSubscriber.py
4545

4646
ENV PYTHONPATH=$LOCALPYDIR:$PYTHONPATH
4747

4848
# This ensures the container will run as non-root by default. Hat tip Pat Riehecky.
49-
# USER 60000:0 # [Commented out so various entrypoint.sh scripts as of Sep-12-2023 continue to work, to be addressed later]
49+
# USER 60000:0 # [Commented out so various entrypoint.sh scripts as of Sep-12-2023 continue to work, to be addressed later]

elisa-logbook/authentication.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"fooUsr": "barPass",
88
}
99

10+
1011
@auth.verify_password
1112
def verify(username, password):
1213
if not (username and password):
1314
return False
14-
return APP_PASS.get(username) == password
15+
return APP_PASS.get(username) == password

0 commit comments

Comments
 (0)