Remove double warning msg when adding cartridges #6369
Conversation
ab6a186
to
4d6c694
Compare
[test] |
3b977d0
to
9dc1288
Compare
report_quota(output, args['--with-container-uuid']) | ||
else | ||
# do not print quota warning (output) during action "configure", to avoid double warning msg | ||
report_quota('', args['--with-container-uuid']) |
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.
If we aren't going to do anything with the output, why run report_quota
at all? It doesn't appear to do anything other than generate output, so it seems needless to run it in this case.
Also, to ensure that quota is reported with everything but the 'configure' step, why not use if action.to_s != "configure"
?
9dc1288
to
b133c7f
Compare
@tiwillia all set? thanks |
@@ -159,7 +159,6 @@ def test_cartridge_do_action_quota | |||
@agent.expects(:request).returns(request).times(3) | |||
|
|||
@agent.expects(:execute_action).with('test_agent', any_parameters).returns [0, 'test output', nil] | |||
@agent.expects(:report_quota).with(instance_of(String), 'uuid') |
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.
Could you explain why this was removed? It looks like the test uses the action 'test_agent', which should match your conditional and report quota.
bz1169690 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1169690 When adding cartridges to an app that is approaching quota limits, the "Warning: Gear <uuid> is using <percent> of disk quota" is printed twice. This PR removes the report_quota when installing a cartridge, so the quota is only reported once after the cartridge is installed.
b133c7f
to
dc0f7c9
Compare
Evaluated for online test up to dc0f7c9 |
Online Test Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/test_pull_requests/9223/) |
@tiwillia fixed up, thank you |
LGTM. In testing, I can see that only one warning message is seen when adding a cartridge. [merge] |
Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/6716/) (Image: devenv_5777) |
Evaluated for online merge up to dc0f7c9 |
bz1169690
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1169690
When adding cartridges to an app that is approaching quota limits,
the "Warning: Gear is using of disk quota" is printed twice.
This PR removes the report_quota when installing a cartridge, so the
quota is only reported once after the cartridge is installed.