-
Notifications
You must be signed in to change notification settings - Fork 846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RabbitMQ config issue in Docker #2739
Conversation
@@ -0,0 +1,41 @@ | |||
from os import environ as env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)
@@ -0,0 +1,41 @@ | |||
from os import environ as env | |||
import json, subprocess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
C0410: Multiple imports on one line (json, subprocess) (multiple-imports)
|
||
config_file = Path("/etc/rabbitmq/definitions.json") | ||
|
||
with config_file.open() as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
with config_file.open() as file: | ||
config = json.load(file) | ||
|
||
hash_processor = subprocess.run(f"rabbitmqctl hash_password {rabbit_pass}".split(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably set check to True
here so it doesn't fail silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config["permissions"][0]["user"] = rabbit_user | ||
config["permissions"][0]["vhost"] = rabbit_vhost | ||
|
||
with config_file.open("w") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
Signed-off-by: Ulincsys <[email protected]>
6280305
to
02d3298
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one subprocess.run
call in the build that can fail silently as well as some other minor linting suggestions. Otherwise looks great and is greatly needed.
with config_file.open() as file: | ||
config = json.load(file) | ||
|
||
hash_processor = subprocess.run(f"rabbitmqctl hash_password {rabbit_pass}".split(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably set check to True
here so it doesn't fail silently.
Oh I just saw that it checks the return code never mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
definitions.json
to contain default user, password, and vhost definitionsupdate_config.py
to convert Docker args to RabbitMQ config itemsaugur.conf
is doing anything anymore, but there's no reason to get rid of it as of right nowupdate_config.py
rabbitmqctl
definitions.json
, update with new values and write changesadvanced.config
RUN echo ...
definitions.json
docker-compose.yml
environment
section toargs
section, update formattingaugur_vhost
)rabbitmq/Dockerfile
Signed commits