P4DTI issue job000158

TitleObscure error if Perforce can't be reached or p4_client_executable is wrong
Statusclosed
Priorityessential
Assigned userRichard Brooksby
OrganizationRavenbrook
DescriptionThe replicator produces an obscure error message if it can't reach the Perforce server. This might be because the server is down or because the configuration is wrong. When it starts, the replicator says "P4DTI Replicator error: p4 info didn't report a recognisable version".
AnalysisThe replicator doens't see a recognizable version because "p4.run" just returns an empty list if the Perforce executable fails completely. So it doesn't see an acceptable version or an unacceptable one. RB 2000-12-14
The exit status of a "popened" command is available from the "close" method on the stream. We should change "p4.run" to check it and throw an exception if it's non zero, rather than returning the empty list, and produce a better message. This exception will be caught at a higher level in the replicator. RB 2000-12-14
How foundcustomer
Evidence<http://info.ravenbrook.com/mail/2000/12/13/16-09-21/0.txt>
<http://info.ravenbrook.com/mail/2000/12/13/16-15-00/0.txt>
<http://info.ravenbrook.com/mail/2000/12/13/17-33-49/0.txt>.
<http://info.ravenbrook.com/mail/2000/12/13/20-15-41/0.txt>
<http://info.ravenbrook.com/mail/2000/12/14/13-34-10/0.txt>
Observed in0.4.2
Test procedure<http://www.ravenbrook.com/project/p4dti/master/test/test_p4dti.py>, section 6.2
Created byRichard Brooksby
Created on2000-12-14 13:53:35
Last modified byGareth Rees
Last modified on2001-12-10 19:15:30
History2000-12-14 RB Created.

Fixes

Change Effect Date User Description
5996 closed 2000-12-14 14:32:25 Richard Brooksby Fixing exit_status zero to None when there's no error.
5995 open 2000-12-14 14:06:16 Richard Brooksby Making "p4.run" throw an exception if the "p4" command returns with non-zero exit code, rather than produce empty output.
Added check for the exit status of the "p4" command so that the caller can tell the difference between empty output and a connection (or other) error.