Commit 2e99c350 authored by nimrod's avatar nimrod
Browse files

Address pre-commit issues.

- Bandit complains on using urlopen, ignore since I'm using a hard-coded
URL.
- Pylint complains on the module name, rename.
- Remove the docker-compose hook, no docker-compose.yml.
parent 176c4097
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
*
!awslogs.conf
!config
!deduce-aws-region
!deduce_aws_region
!entrypoint
+0 −2
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ repos:
    rev: v0.3.0
    hooks:
      - id: hadolint
      - id: docker-compose


  - repo: https://github.com/ambv/black
    rev: 20.8b1
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ RUN pip install --no-cache-dir --progress-bar=off \
COPY --chown=root:root config /etc/aws/
COPY --chown=root:root entrypoint /usr/local/bin/
COPY --chown=root:root awslogs.conf /var/awslogs/etc/awslogs.conf.j2
COPY --chown=root:root deduce-aws-region /usr/local/bin/
COPY --chown=root:root deduce_aws_region /usr/local/bin/
USER nobody
ENV AWS_CONFIG_FILE="/etc/aws/config" \
    LOG_GROUP_NAME="" \
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ from urllib.request import urlopen
import json

if __name__ == "__main__":
    response = urlopen(
    response = urlopen(  # nosec
        "http://169.254.169.254/latest/dynamic/instance-identity/document"
    )
    print(json.loads(response.read().decode("utf-8"))["region"])
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ set -eux
template /var/awslogs/etc/awslogs.conf.j2 > /tmp/config
if [ -z "${AWS_DEFAULT_REGION:-}" ]
then
    AWS_DEFAULT_REGION="$(deduce-aws-region)"
    AWS_DEFAULT_REGION="$(deduce_aws_region)"
    export AWS_DEFAULT_REGION
fi
eval exec "$@"