Use the "Server address:" field from "p4 info" and don't use gethostbyaddr() on the result

Review Request #1818 — Created Oct. 12, 2010 and discarded

Information

RBTools

Reviewers

"p4 info" gives the 'Server Address:' for the Perforce server.  This value is static, so why then look it up with gethostbyaddr()?

If gethostbyaddr() returns multiple names (i.e. "hostname" and "hostname.domain.com") then this code block puts the value in a list, which will fail to translate when the review is encoded for http upload.

You can see the result in the output.  This is "good" :
>>> p4 info
>>> repository info: Path: p4server.domain.com:1666, Base path: None, Supports changesets: True

This is "bad" (and fixed by this patch) :
>>> p4 info
>>> repository info: Path: ['p4server:1666', 'p4server.domain.com:1666'], Base path: None, Supports changesets: True

The side effect of this patch is that the repository configuration on the Review Board server (for Perforce) MUST match the value for 'Server Address:' in "p4 info"
I didn't need this patch until this weekend, when I migrated our Perforce server to a new location.  The change in network meant that I now see two values in the gethostbyaddr() call.

With this patch, everything works perfectly.
Loading...