diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 08:30:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:02 +0100 |
commit | 0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch) | |
tree | 7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bb/fetch2/sftp.py | |
parent | ef1df516512587ad415f76a9626620992d660e45 (diff) | |
download | poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz |
bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.
(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/sftp.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/sftp.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/sftp.py b/bitbake/lib/bb/fetch2/sftp.py index cb2f753a8e..7989fccc75 100644 --- a/bitbake/lib/bb/fetch2/sftp.py +++ b/bitbake/lib/bb/fetch2/sftp.py | |||
@@ -61,8 +61,7 @@ SRC_URI = "sftp://user@host.example.com/dir/path.file.txt" | |||
61 | 61 | ||
62 | import os | 62 | import os |
63 | import bb | 63 | import bb |
64 | import urllib | 64 | import urllib.request, urllib.parse, urllib.error |
65 | import commands | ||
66 | from bb import data | 65 | from bb import data |
67 | from bb.fetch2 import URI | 66 | from bb.fetch2 import URI |
68 | from bb.fetch2 import FetchMethod | 67 | from bb.fetch2 import FetchMethod |
@@ -93,7 +92,7 @@ class SFTP(FetchMethod): | |||
93 | else: | 92 | else: |
94 | ud.basename = os.path.basename(ud.path) | 93 | ud.basename = os.path.basename(ud.path) |
95 | 94 | ||
96 | ud.localfile = data.expand(urllib.unquote(ud.basename), d) | 95 | ud.localfile = data.expand(urllib.parse.unquote(ud.basename), d) |
97 | 96 | ||
98 | def download(self, ud, d): | 97 | def download(self, ud, d): |
99 | """Fetch urls""" | 98 | """Fetch urls""" |
@@ -121,8 +120,7 @@ class SFTP(FetchMethod): | |||
121 | 120 | ||
122 | remote = '%s%s:%s' % (user, urlo.hostname, path) | 121 | remote = '%s%s:%s' % (user, urlo.hostname, path) |
123 | 122 | ||
124 | cmd = '%s %s %s %s' % (basecmd, port, commands.mkarg(remote), | 123 | cmd = '%s %s %s %s' % (basecmd, port, remote, lpath) |
125 | commands.mkarg(lpath)) | ||
126 | 124 | ||
127 | bb.fetch2.check_network_access(d, cmd, ud.url) | 125 | bb.fetch2.check_network_access(d, cmd, ud.url) |
128 | runfetchcmd(cmd, d) | 126 | runfetchcmd(cmd, d) |