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

fix: engine incorrect auto_stop update in case it is 0 #161

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

yuryfirebolt
Copy link
Contributor

No description provided.

Copy link
Collaborator

@ptiurin ptiurin left a comment

Choose a reason for hiding this comment

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

Apart from that suggestion, lgtm

@@ -354,7 +354,9 @@ class _EngineUpdateRequest(FireboltBaseModel):
# Update engine settings
engine_settings_params = {
"engine_type": engine_type,
"auto_stop_delay_duration": f"{auto_stop * 60}s" if auto_stop else None,
"auto_stop_delay_duration": f"{auto_stop * 60}s"
if auto_stop is not None
Copy link
Collaborator

Choose a reason for hiding this comment

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

While we're at it should we exclude negative numbers as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So far we don't do any input validation. It is just when auto_stop was set to zero, which is a valid value, the if statement didn't allow to propagate it.

@sonarcloud
Copy link

sonarcloud bot commented Apr 29, 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

33.3% 33.3% Coverage
0.0% 0.0% Duplication

@yuryfirebolt yuryfirebolt merged commit a1dd1f8 into main Apr 29, 2022
@yuryfirebolt yuryfirebolt deleted the FIR-13104-engine-update-auto-stop branch April 29, 2022 11:27
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.

2 participants