diff options
author | Chris Lumens <clumens@redhat.com> | 2008-05-16 20:25:32 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-07-22 15:57:42 -0400 |
commit | d5b01ce6fae089526c60db0bbafd3b99cc6a2200 (patch) | |
tree | b32f5f2b8fba314642a5bd6a7a0ae238decb097e /exception.py | |
parent | 51ed802c7553c0b32b1465975c9364797f54fd43 (diff) | |
download | anaconda-d5b01ce6fae089526c60db0bbafd3b99cc6a2200.tar.gz anaconda-d5b01ce6fae089526c60db0bbafd3b99cc6a2200.tar.xz anaconda-d5b01ce6fae089526c60db0bbafd3b99cc6a2200.zip |
Remove the code to save exceptions over scp.
Diffstat (limited to 'exception.py')
-rw-r--r-- | exception.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/exception.py b/exception.py index 5a41e9e09..865135517 100644 --- a/exception.py +++ b/exception.py @@ -197,76 +197,6 @@ def dumpException(out, text, tb, anaconda): out.write("\nException occurred during %s file copy:\n" % (file,)) traceback.print_exc(None, out) -def scpAuthenticate(master, childpid, password): - while 1: - # Read up to password prompt. Propagate OSError exceptions, which - # can occur for anything that causes scp to immediately die (bad - # hostname, host down, etc.) - buf = os.read(master, 4096) - if buf.lower().find("password: ") != -1: - os.write(master, password+"\n") - # read the space and newline that get echoed back - os.read(master, 2) - break - - while 1: - buf = "" - try: - buf = os.read(master, 4096) - except (OSError, EOFError): - break - - (pid, childstatus) = os.waitpid (childpid, 0) - return childstatus - -# Save the traceback to a remote system via SCP. Returns success or not. -def copyExceptionToRemote(intf, scpInfo): - import pty - - (host, path, user, password) = scpInfo - - if host.find(":") != -1: - (host, port) = host.split(":") - - # Try to convert the port to an integer just as a check to see - # if it's a valid port number. If not, they'll get a chance to - # correct the information when scp fails. - try: - int(port) - portArgs = ["-P", port] - except ValueError: - portArgs = [] - else: - portArgs = [] - - # Thanks to Will Woods <wwoods@redhat.com> for the scp control - # here and in scpAuthenticate. - - # Fork ssh into its own pty - (childpid, master) = pty.fork() - if childpid < 0: - log.critical("Could not fork process to run scp") - return False - elif childpid == 0: - # child process - run scp - args = ["scp", "-oNumberOfPasswordPrompts=1", - "-oStrictHostKeyChecking=no"] + portArgs + \ - ["/tmp/anacdump.txt", "%s@%s:%s" % (user, host, path)] - os.execvp("scp", args) - - # parent process - try: - childstatus = scpAuthenticate(master, childpid, password) - except OSError: - return False - - os.close(master) - - if os.WIFEXITED(childstatus) and os.WEXITSTATUS(childstatus) == 0: - return True - else: - return False - # Save the traceback to a removable storage device, such as a floppy disk # or a usb/firewire drive. If there's no filesystem on the disk/partition, # write a vfat one. |