Skip to content
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

Bugfix/307 Fix replace_config to read prom2teams config #316

Merged
merged 7 commits into from
Dec 21, 2022

Conversation

santi-eidu
Copy link
Contributor

@santi-eidu santi-eidu commented Nov 21, 2022

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions
  • Remember to set idealista:develop as base branch;

Description of the Change

After #307 in version 4.0.0 prom2teams config in docker volume returns an error. With tmp files you can control when to replace variables.

Benefits

Now you can add prom2teams config via volumen in docker.

Possible Drawbacks

N/A.

Applicable Issues

#307

@santi-eidu santi-eidu changed the title Bugfix/307 Bugfix/307 Fix replace_config to read prom2teams config Nov 21, 2022
@abdennour
Copy link

then? what it will be reviewed ?
BTW, are you bypassing error handling?!

Copy link

@abdennour abdennour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check my comments

with open('/opt/prom2teams/config.ini', 'w') as file:
file.write(filedata)
except (PermissionError, OSError) as error:
pass

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you bypassing error handling ? If there is actual error, why we ignore it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to tmp config files in case of config file from docker volume.

try:
with open('/opt/prom2teams/uwsgi.ini', 'w') as file:
file.write(uwsgi_filedata)
except (PermissionError, OSError) as error:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to tmp config files in case of config file from docker volume.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@santi-eidu santi-eidu merged commit dc32a87 into develop Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants