summaryrefslogtreecommitdiffstats
path: root/exception.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-02-26 20:25:16 +0000
committerChris Lumens <clumens@redhat.com>2007-02-26 20:25:16 +0000
commit1b76ce5fee64f229636cb125133d8911096dcaf7 (patch)
treedde8b5c42ad2842c946548feace39474a2b9ecdb /exception.py
parentfc885e01912017efe3e2d8f1774b344fbf77dcc6 (diff)
downloadanaconda-1b76ce5fee64f229636cb125133d8911096dcaf7.tar.gz
anaconda-1b76ce5fee64f229636cb125133d8911096dcaf7.tar.xz
anaconda-1b76ce5fee64f229636cb125133d8911096dcaf7.zip
Center scp window. Change label to let the user know port numbers are
accepted. Handle port numbers in the host string (#227909).
Diffstat (limited to 'exception.py')
-rw-r--r--exception.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/exception.py b/exception.py
index e9a7f468e..e9eb23b59 100644
--- a/exception.py
+++ b/exception.py
@@ -224,6 +224,20 @@ def copyExceptionToRemote(intf):
(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.
@@ -236,8 +250,8 @@ def copyExceptionToRemote(intf):
elif childpid == 0:
# child process - run scp
args = ["scp", "-oNumberOfPasswordPrompts=1",
- "-oStrictHostKeyChecking=no", "/tmp/anacdump.txt",
- "%s@%s:%s" % (user, host, path)]
+ "-oStrictHostKeyChecking=no"] + portArgs + \
+ ["/tmp/anacdump.txt", "%s@%s:%s" % (user, host, path)]
os.execvp("scp", args)
# parent process