Do not fail when no scp command is found, unless it is actually needed to fetch something
Review Request #127 - Created Jan. 28, 2011 and submitted
Oz Linden | Reviewers | ||
viewer | |||
None | autobuild |
During initialization, if there is no scp or pscp command found then autobuild fails immediately. This is true whether or not any scp urls need to be used. This change modifies the behavior so that a warning is printed if no command is found, but execution proceeds until an scp command is needed, at which time execution fails with an explanatory message. This patch can print the warning multiple times - I didn't attempt to suppress the extras.
I've tested this locally, simulating the error by temporarily modifying the names of the commands to be found for scp. I have not checked it on Windows, where the original problem was found.
Looks plausible at first sight.
Posted (Jan. 28, 2011, 5:51 a.m.)
-
autobuild/common.py (Diff revision 1) -
Why send out a warning at this point? Developers who will never use scp don't benefit from this message. If scp is needed and is not present having the error sent out later should be sufficient.
Tested on Windows 7 32-bit and works all the needed files for NonStandalone do not DL at least the error is gone.
Worked as designed/explained. For other dummies like me if you did setup.py install before the patch, you need to repeat it to get the new patched version working in python.
Posted (Jan. 28, 2011, 2:46 p.m.)
-
autobuild/common.py (Diff revision 1) -
Why not use None here? I think that is more Pythonie.
-
autobuild/common.py (Diff revision 1) -
...and test for None here.
Review request changed
Updated (Jan. 29, 2011, 5:01 a.m.)
-
- added Diff r2
removed the (possibly repeated) warnings about not finding an scp command changed to using None properly rather than a fixed string value (added logging that should have shown for doing scp copies, but --verbose does not seem to do anything.... different issue)
Posted (Jan. 29, 2011, 7:28 a.m.)
this is crashing devenv when you do autobuild build -c OpenSourceRelWithDebInfo on a windows system
Posted (Jan. 29, 2011, 1:23 p.m.)
-
autobuild/common.py (Diff revisions 1 - 2) -
The docstring of find_executable should probably indicate that ...
-
autobuild/common.py (Diff revisions 1 - 2) -
... the return value is None when no matching executable can be found, as we (somewhat) rely on what the return value is in that case. (Not your fault, the old code already relied on that, too.)
-
autobuild/common.py (Diff revisions 1 - 2) -
Usually one would test for None with if self._scp is None: as testing for `not self._scp` will also trigger when the value is False (obviously) or (maybe less obvious) becomes False when casted to bool. However, because we don't want self._scp to be an empty string when building the command below ...
-
autobuild/common.py (Diff revisions 1 - 2) -
... testing for `not self._scp` here might actually be better, I'm not sure.
Other reviews