Do not crash when ip is not found
ClosedPublic

Authored by mkrizek on Feb 2 2016, 12:50 PM.

Details

Summary

This will at least prevent from the mysterious TypeError. We still need to investigate why it's failing to find ip. So far, this has been happening only on qa12 (one of the prod host clients).

Test Plan

None really :/

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
mkrizek retitled this revision from to Do not crash when ip is not found.Feb 2 2016, 12:50 PM
mkrizek updated this object.
mkrizek edited the test plan for this revision. (Show Details)
mkrizek added a reviewer: tflink.
mkrizek set the repository for this revision to rTCLOUD testcloud.
mkrizek added a project: testcloud.
tflink requested changes to this revision.Feb 2 2016, 1:24 PM

The approach loks good to me but if you're changing that function, can you add a try/catch with error around the methods which call it in testcloud/cli.py?

Also, a small nitpick on the exact wording of the exception message thrown

testcloud/cli.py
337

I'd also like to see the timeout referenced in the essage - something along the lines of "Could not find VM\'s ip before timeout"

This revision now requires changes to proceed.Feb 2 2016, 1:24 PM
In D737#13989, @tflink wrote:

The approach loks good to me but if you're changing that function, can you add a try/catch with error around the methods which call it in testcloud/cli.py?

Don't we just want to raise the exception? The message of the exception is clear on what happened. Looking at the code, it's done like that (just `raise) in the whole cli.py. We don't catch DomainNotFoundError that find_vm_ip` raises either. Or am I misunderstanding?

Good point on mentioning the timeout in the message though.

tflink added a comment.Feb 3 2016, 8:21 AM
In D737#13994, @mkrizek wrote:
In D737#13989, @tflink wrote:

The approach loks good to me but if you're changing that function, can you add a try/catch with error around the methods which call it in testcloud/cli.py?

Don't we just want to raise the exception? The message of the exception is clear on what happened. Looking at the code, it's done like that (just `raise) in the whole cli.py. We don't catch DomainNotFoundError that find_vm_ip` raises either. Or am I misunderstanding?

You're right - there's no point in deviating from what was already there.

Good point on mentioning the timeout in the message though.

That would be nice, though

mkrizek updated this revision to Diff 1891.Feb 3 2016, 8:31 AM
mkrizek removed rTCLOUD testcloud as the repository for this revision.
tflink accepted this revision.Feb 3 2016, 8:52 AM
This revision is now accepted and ready to land.Feb 3 2016, 8:52 AM
mkrizek closed this revision.Feb 3 2016, 12:32 PM

Pull request with this patch sent to testcloud github. Closing.