File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
- 0.1.05
1
+ 0.1.06
Original file line number Diff line number Diff line change 1
- from webhdfs . webhdfs import WebHDFS
1
+ from webhdfs import WebHDFS
2
2
import os , tempfile
3
3
import time
4
4
19
19
webhdfs .copyToLocal ("/hello-world/test.txt" ,
20
20
"/tmp/test1.txt" )
21
21
22
- for i in webhdfs .listdir ("/" ):
22
+ for i in webhdfs .listdir ("/hello-world/ " ):
23
23
print str (i )
24
24
25
- f .close ()
25
+ f .close ()
Original file line number Diff line number Diff line change @@ -127,7 +127,11 @@ def listdir(self, path):
127
127
response = httpClient .getresponse ()
128
128
logger .debug ("HTTP Response: %d, %s" % (response .status , response .reason ))
129
129
data_dict = json .loads (response .read ())
130
- files = [i ["localName" ] for i in data_dict ["HdfsFileStatus" ]]
130
+ logger .debug ("Data: " + str (data_dict ))
131
+ files = []
132
+ for i in data_dict ["FileStatuses" ]["FileStatus" ]:
133
+ logger .debug (i ["type" ] + ": " + i ["pathSuffix" ])
134
+ files .append (i ["pathSuffix" ])
131
135
httpClient .close ()
132
136
return files
133
137
You can’t perform that action at this time.
0 commit comments