1 From ecaf5c44da357e2ee5279a3f84a060f7af2c9dd1 Mon Sep 17 00:00:00 2001
2 From: zhipengl <zhipengs.liu@intel.com>
3 Date: Fri, 21 Jun 2019 01:50:14 +0800
4 Subject: [PATCH] Adapt-redfishtool-to-python2
6 Signed-off-by: zhipengl <zhipengs.liu@intel.com>
8 redfishtool/AccountService.py | 18 +++++++++---------
9 redfishtool/Chassis.py | 22 +++++++++++-----------
10 redfishtool/Managers.py | 29 ++++++++++++++---------------
11 redfishtool/ServiceRoot.py | 2 +-
12 redfishtool/SessionService.py | 10 +++++-----
13 redfishtool/Systems.py | 36 ++++++++++++++++++------------------
14 redfishtool/raw.py | 2 +-
15 redfishtool/redfishtoolTransport.py | 29 ++++++++++++++---------------
17 9 files changed, 74 insertions(+), 75 deletions(-)
19 diff --git a/redfishtool/AccountService.py b/redfishtool/AccountService.py
20 index e0ec106..bfb17f8 100644
21 --- a/redfishtool/AccountService.py
22 +++ b/redfishtool/AccountService.py
23 @@ -34,7 +34,7 @@ import getopt
26 from .ServiceRoot import RfServiceRoot
27 -from urllib.parse import urljoin
28 +from urlparse import urljoin
30 class RfAccountServiceMain():
32 @@ -259,13 +259,13 @@ class RfAccountServiceOperations():
33 #loop through the members and create the list sub-operation response
34 rc,r,j,d=rft.listCollection(rft, r, d, prop="UserName")
36 - rft.printVerbose(1," list {} Collection member info: Id, URI, UserName".format(collName,skip1=True, printV12=cmdTop))
37 + rft.printVerbose(1," list {} Collection member info: Id, URI, UserName".format(collName), skip1=True, printV12=cmdTop)
39 # else: check if no account was specified. If not, return the collection
40 elif(rft.IdLevel2OptnCount==0):
41 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=accountsLink, prop=prop)
43 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
44 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
46 # else: check if the -a (all) option is set. If not, return the session specific by -i or -m or -l
47 # search collection to find path using getPath2
48 @@ -287,14 +287,14 @@ class RfAccountServiceOperations():
50 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
52 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
53 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
55 # else, return ALL of the Accounts members
57 rft.printVerbose(4,"getting expanded Accounts Collection")
58 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=accountsLink)
60 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
61 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
65 @@ -324,13 +324,13 @@ class RfAccountServiceOperations():
66 #loop through the members and create the list sub-operation response
67 rc,r,j,d=rft.listCollection(rft, r, d, prop="IsPredefined")
69 - rft.printVerbose(1," list {} Collection member info: Id, URI, IsPredefined".format(collName,skip1=True, printV12=cmdTop))
70 + rft.printVerbose(1," list {} Collection member info: Id, URI, IsPredefined".format(collName), skip1=True, printV12=cmdTop)
72 # else: check if no account was specified. If not, return the collection
73 elif(rft.IdLevel2OptnCount==0):
74 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=rolesLink, prop=prop)
76 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
77 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
79 # else: check if the -a (all) option is set. If not, return the session specific by -i or -m or -l
80 # search collection to find path using getPath2
81 @@ -352,14 +352,14 @@ class RfAccountServiceOperations():
83 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
85 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
86 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
88 # else, return ALL of the Accounts members
90 rft.printVerbose(4,"getting expanded Roles Collection")
91 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=rolesLink)
93 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
94 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
98 diff --git a/redfishtool/Chassis.py b/redfishtool/Chassis.py
99 index d8f0bf5..0494bd9 100644
100 --- a/redfishtool/Chassis.py
101 +++ b/redfishtool/Chassis.py
102 @@ -37,7 +37,7 @@ import getopt
105 from .ServiceRoot import RfServiceRoot
106 -from urllib.parse import urljoin
107 +from urlparse import urljoin
109 class RfChassisMain():
111 @@ -208,7 +208,7 @@ class RfChassisOperations():
112 rft.printVerbose(4,"Expand Chassis collection to return ALL Chassis collection members fully expanded in response")
113 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=systemsLink)
115 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
116 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
118 # otherwise, just return the collection
119 # now read the /Chassis collection
120 @@ -217,7 +217,7 @@ class RfChassisOperations():
121 if cmdTop is True: prop=rft.prop
122 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=systemsLink, prop=prop)
124 - rft.printVerbose(1," Chassis Collection:",skip1=True, printV12=cmdTop)
125 + rft.printVerbose(1," Chassis Collection:", skip1=True, printV12=cmdTop)
129 @@ -262,7 +262,7 @@ class RfChassisOperations():
130 #loop through the members and create the list sub-operation response
131 rc,r,j,d=rft.listCollection(rft, r, d, prop="AssetTag")
133 - rft.printVerbose(1," list {} Collection member info: Id, URI, AssetTag".format(collName,skip1=True, printV12=cmdTop))
134 + rft.printVerbose(1," list {} Collection member info: Id, URI, AssetTag".format(collName), skip1=True, printV12=cmdTop)
138 @@ -439,7 +439,7 @@ class RfChassisOperations():
140 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=resLink, prop=prop)
142 - rft.printVerbose(1," {} Resource ".format(resName,skip1=True, printV12=cmdTop))
143 + rft.printVerbose(1," {} Resource ".format(resName), skip1=True, printV12=cmdTop)
147 @@ -464,7 +464,7 @@ class RfChassisOperations():
149 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=resLink, prop=prop)
151 - rft.printVerbose(1," {} Resource ".format(resName,skip1=True, printV12=cmdTop))
152 + rft.printVerbose(1," {} Resource ".format(resName), skip1=True, printV12=cmdTop)
156 @@ -521,13 +521,13 @@ class RfChassisOperations():
157 if( prop in powerControl[indx] ):
158 respDataVal=powerControl[indx][prop]
159 respData={prop: respDataVal}
160 - rft.printVerbose(1," Get Current Power consumption (PowerConsumedWatts) of PowerControl[{}] resource".format(indx,skip1=True, printV12=cmdTop))
161 + rft.printVerbose(1," Get Current Power consumption (PowerConsumedWatts) of PowerControl[{}] resource".format(indx), skip1=True, printV12=cmdTop)
163 rft.printErr("Error: Property {} not not returned in PowerControl[{}] resource".format(prop,indx))
166 respData=powerControl[indx] #return the full powerControl array
167 - rft.printVerbose(1," Chassis PowerControl[{}] array:".format(indx,skip1=True, printV12=cmdTop))
168 + rft.printVerbose(1," Chassis PowerControl[{}] array:".format(indx), skip1=True, printV12=cmdTop)
170 return(rc,r,j,respData)
172 @@ -684,13 +684,13 @@ class RfChassisOperations():
173 #loop through the members and create the list sub-operation response
174 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name")
176 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
177 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
179 # else: check if no Log was specified. If not, return the collection
180 elif(rft.IdLevel2OptnCount==0):
181 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=logLink, prop=prop)
183 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
184 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
186 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
187 # search collection to find path using getPath2
188 @@ -712,7 +712,7 @@ class RfChassisOperations():
190 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
192 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
193 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
195 # If '--Entries' specified, get "Entries" nav link and read it
196 if rc == 0 and rft.gotEntriesOptn:
197 diff --git a/redfishtool/Managers.py b/redfishtool/Managers.py
198 index 586a871..400dad7 100644
199 --- a/redfishtool/Managers.py
200 +++ b/redfishtool/Managers.py
201 @@ -37,7 +37,7 @@ import getopt
204 from .ServiceRoot import RfServiceRoot
205 -from urllib.parse import urljoin
206 +from urlparse import urljoin
208 class RfManagersMain():
210 @@ -211,7 +211,7 @@ class RfManagersOperations():
211 rft.printVerbose(4,"Expand Managers collection to return ALL Managers collection members fully expanded in response")
212 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=systemsLink)
214 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
215 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
217 # otherwise, just return the collection
218 # now read the /Managers collection
219 @@ -467,7 +467,7 @@ class RfManagersOperations():
221 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=resLink, prop=prop)
223 - rft.printVerbose(1," {} Resource ".format(resName,skip1=True, printV12=cmdTop))
224 + rft.printVerbose(1," {} Resource ".format(resName), skip1=True, printV12=cmdTop)
228 @@ -503,13 +503,13 @@ class RfManagersOperations():
229 #loop through the members and create the list sub-operation response
230 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name")
232 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
233 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
235 # else: check if no NIC was specified. If not, return the collection
236 elif(rft.IdLevel2OptnCount==0):
237 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=nicLink, prop=prop)
239 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
240 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
242 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
243 # search collection to find path using getPath2
244 @@ -531,14 +531,14 @@ class RfManagersOperations():
246 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
248 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
249 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
251 # else, return ALL of the EthernetInterfaces members
253 rft.printVerbose(4,"getting expanded EthernetInterfaces Collection")
254 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=nicLink)
256 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
257 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
261 @@ -568,13 +568,13 @@ class RfManagersOperations():
262 #loop through the members and create the list sub-operation response
263 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name" )
265 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
266 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
268 # else: check if no SerialInterfaces controller was specified. If not, return the collection
269 elif(rft.IdLevel2OptnCount==0):
270 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=cntlrLink, prop=prop)
272 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
273 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
275 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
276 # search collection to find path using getPath2
277 @@ -596,14 +596,14 @@ class RfManagersOperations():
279 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
281 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
282 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
284 # else, return ALL of the SerialInterfaces members
286 rft.printVerbose(4,"getting expanded SerialInterfaces Collection")
287 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=cntlrLink)
289 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
290 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
294 @@ -633,13 +633,12 @@ class RfManagersOperations():
295 #loop through the members and create the list sub-operation response
296 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name")
298 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
300 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
301 # else: check if no Log was specified. If not, return the collection
302 elif(rft.IdLevel2OptnCount==0):
303 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=logLink, prop=prop)
305 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
306 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
308 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
309 # search collection to find path using getPath2
310 @@ -661,7 +660,7 @@ class RfManagersOperations():
312 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
314 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
315 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
317 # If '--Entries' specified, get "Entries" nav link and read it
318 if rc == 0 and rft.gotEntriesOptn:
319 diff --git a/redfishtool/ServiceRoot.py b/redfishtool/ServiceRoot.py
320 index 5d85b5d..9395b83 100644
321 --- a/redfishtool/ServiceRoot.py
322 +++ b/redfishtool/ServiceRoot.py
327 -from urllib.parse import urljoin, urlparse, urlunparse
328 +from urlparse import urljoin, urlparse, urlunparse
332 diff --git a/redfishtool/SessionService.py b/redfishtool/SessionService.py
333 index 7a07811..c7a1624 100644
334 --- a/redfishtool/SessionService.py
335 +++ b/redfishtool/SessionService.py
336 @@ -30,7 +30,7 @@ import getopt
339 from .ServiceRoot import RfServiceRoot
340 -from urllib.parse import urljoin
341 +from urlparse import urljoin
343 class RfSessionServiceMain():
345 @@ -267,13 +267,13 @@ class RfSessionServiceOperations():
346 #loop through the members and create the list sub-operation response
347 rc,r,j,d=rft.listCollection(rft, r, d, prop="UserName")
349 - rft.printVerbose(1," list {} Collection member info: Id, URI, Socket".format(collName,skip1=True, printV12=cmdTop))
350 + rft.printVerbose(1," list {} Collection member info: Id, URI, Socket".format(collName), skip1=True, printV12=cmdTop)
352 # else: check if no session was specified. If not, return the collection
353 elif(rft.IdLevel2OptnCount==0):
354 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=sessionsLink, prop=prop)
356 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
357 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
359 # else: check if the -a (all) option is set. If not, return the session specific by -i or -m or -l
360 # search collection to find path using getPath2
361 @@ -295,14 +295,14 @@ class RfSessionServiceOperations():
363 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
365 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
366 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
368 # else, return ALL of the Sessions members
370 rft.printVerbose(4,"getting expanded Sessions Collection")
371 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=sessionsLink)
373 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
374 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
378 diff --git a/redfishtool/Systems.py b/redfishtool/Systems.py
379 index 9a7dfbe..9a9148a 100644
380 --- a/redfishtool/Systems.py
381 +++ b/redfishtool/Systems.py
382 @@ -39,7 +39,7 @@ import getopt
385 from .ServiceRoot import RfServiceRoot
386 -from urllib.parse import urljoin
387 +from urlparse import urljoin
389 class RfSystemsMain():
391 @@ -216,7 +216,7 @@ class RfSystemsOperations():
392 rft.printVerbose(4,"Expand Systems collection to return ALL Systems collection members fully expanded in response")
393 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=systemsLink)
395 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
396 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
398 # otherwise, just return the collection
399 # now read the /Systems collection
400 @@ -419,7 +419,7 @@ class RfSystemsOperations():
404 - rft.printVerbose(1," Systems reset: ", resetType, skip1=True, printV12=cmdTop)
405 + rft.printVerbose(1,(" Systems reset: {}").format(resetType), skip1=True, printV12=cmdTop)
407 return(rc,r,False,resetd)
408 else: return(rc,r,False,None)
409 @@ -623,13 +623,13 @@ class RfSystemsOperations():
410 #loop through the members and create the list sub-operation response
411 rc,r,j,d=rft.listCollection(rft, r, d, prop="Socket")
413 - rft.printVerbose(1," list {} Collection member info: Id, URI, Socket".format(collName,skip1=True, printV12=cmdTop))
414 + rft.printVerbose(1," list {} Collection member info: Id, URI, Socket".format(collName), skip1=True, printV12=cmdTop)
416 # else: check if no proc was specified. If not, return the collection
417 elif(rft.IdLevel2OptnCount==0):
418 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=procsLink, prop=prop)
420 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
421 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
423 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
424 # search collection to find path using getPath2
425 @@ -651,14 +651,14 @@ class RfSystemsOperations():
427 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
429 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
430 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
432 # else, return ALL of the processor members
434 rft.printVerbose(4,"getting expanded Processor Collection")
435 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=procsLink)
437 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
438 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
442 @@ -688,13 +688,13 @@ class RfSystemsOperations():
443 #loop through the members and create the list sub-operation response
444 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name")
446 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
447 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
449 # else: check if no NIC was specified. If not, return the collection
450 elif(rft.IdLevel2OptnCount==0):
451 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=nicLink, prop=prop)
453 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
454 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
456 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
457 # search collection to find path using getPath2
458 @@ -716,14 +716,14 @@ class RfSystemsOperations():
460 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
462 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
463 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
465 # else, return ALL of the EthernetInterfaces members
467 rft.printVerbose(4,"getting expanded EthernetInterfaces Collection")
468 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=nicLink)
470 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
471 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
475 @@ -753,13 +753,13 @@ class RfSystemsOperations():
476 #loop through the members and create the list sub-operation response
477 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name" )
479 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
480 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
482 # else: check if no SimpleStorage controller was specified. If not, return the collection
483 elif(rft.IdLevel2OptnCount==0):
484 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=cntlrLink, prop=prop)
486 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
487 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
489 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
490 # search collection to find path using getPath2
491 @@ -781,14 +781,14 @@ class RfSystemsOperations():
493 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
495 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
496 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
498 # else, return ALL of the SimpleStorage members
500 rft.printVerbose(4,"getting expanded SimpleStorage Collection")
501 rc,r,j,d=rft.getAllCollectionMembers(rft, r.url, relPath=cntlrLink)
503 - rft.printVerbose(1," Get ALL {} Collection Members".format(collName,skip1=True, printV12=cmdTop))
504 + rft.printVerbose(1," Get ALL {} Collection Members".format(collName), skip1=True, printV12=cmdTop)
508 @@ -818,13 +818,13 @@ class RfSystemsOperations():
509 #loop through the members and create the list sub-operation response
510 rc,r,j,d=rft.listCollection(rft, r, d, prop="Name")
512 - rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName,skip1=True, printV12=cmdTop))
513 + rft.printVerbose(1," list {} Collection member info: Id, URI, Name".format(collName), skip1=True, printV12=cmdTop)
515 # else: check if no Log was specified. If not, return the collection
516 elif(rft.IdLevel2OptnCount==0):
517 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', r.url, relPath=logLink, prop=prop)
519 - rft.printVerbose(1," {} Collection ".format(collName,skip1=True, printV12=cmdTop))
520 + rft.printVerbose(1," {} Collection ".format(collName), skip1=True, printV12=cmdTop)
522 # else: check if the -a (all) option is set. If not, return the proc specific by -i or -m
523 # search collection to find path using getPath2
524 @@ -846,7 +846,7 @@ class RfSystemsOperations():
526 rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', collUrl, relPath=path2, prop=prop)
528 - rft.printVerbose(1," {} Collection Member ".format(collName,skip1=True, printV12=cmdTop))
529 + rft.printVerbose(1," {} Collection Member ".format(collName), skip1=True, printV12=cmdTop)
531 # If '--Entries' specified, get "Entries" nav link and read it
532 if rc == 0 and rft.gotEntriesOptn:
533 diff --git a/redfishtool/raw.py b/redfishtool/raw.py
534 index bfb617c..1b32d0b 100644
535 --- a/redfishtool/raw.py
536 +++ b/redfishtool/raw.py
537 @@ -30,7 +30,7 @@ import getopt
540 #from .ServiceRoot import RfServiceRoot
541 -from urllib.parse import urljoin, urlparse, urlunparse
542 +from urlparse import urljoin, urlparse, urlunparse
546 diff --git a/redfishtool/redfishtoolTransport.py b/redfishtool/redfishtoolTransport.py
547 index 017fa11..f157eff 100644
548 --- a/redfishtool/redfishtoolTransport.py
549 +++ b/redfishtool/redfishtoolTransport.py
550 @@ -39,7 +39,7 @@ import json
554 -from urllib.parse import urljoin, urlparse, urlunparse
555 +from urlparse import urljoin, urlparse, urlunparse
556 from requests.auth import HTTPBasicAuth, AuthBase
557 from .ServiceRoot import RfServiceRoot
559 @@ -730,31 +730,32 @@ class RfTransport():
563 - def printVerbose(self,v,*argv, skip1=False, printV12=True,**kwargs):
564 + def printVerbose(self,v, argv, skip1=False, printV12=True):
567 if( (v==1 or v==2) and (printV12 is True) and (self.verbose >= v )):
568 if(skip1 is True): print("#")
569 - print("#",*argv, **kwargs)
571 elif( (v==1 or v==2) and (self.verbose >4 )):
572 if(skip1 is True): print("#")
573 - print("#",*argv, **kwargs)
575 elif((v==3 ) and (printV12 is True) and (self.verbose >=v)):
576 if(skip1 is True): print("#")
577 - print("#REQUEST:",*argv,file=sys.stdout,**kwargs)
578 + sys.stdout.write("#REQUEST:",argv)
579 + # print("#REQUEST:",argv,file=sys.stdout)
580 elif((v==4 or v==5) and (self.verbose >=v)):
581 if(skip1 is True): print("#")
582 - print("#DB{}:".format(v),*argv,file=sys.stdout,**kwargs)
583 + sys.stdout.write("#DB{}:".format(v),argv)
584 + # print("#DB{}:".format(v),argv,file=sys.stdout)
585 elif( v==0): #print no mater value of verbose, but not if quiet=1
586 if(skip1 is True): print("")
587 - print(*argv, **kwargs)
593 #if you set v= anything except 0,1,2,3,4,5 it is ignored
596 def printStatus(self, s, r=None, hdrs=None, authMsg=None, addSessionLoginInfo=False):
599 @@ -785,22 +786,20 @@ class RfTransport():
605 - def printErr(self,*argv,noprog=False,prepend="",**kwargs):
606 + def printErr(self,argv,noprog=False,prepend=""):
607 if( self.quiet == False):
609 - print(prepend,*argv, file=sys.stderr, **kwargs)
610 + sys.stderr.write("{}{}".format(prepend,argv))
612 - print(prepend," {}:".format(self.program),*argv, file=sys.stderr, **kwargs)
613 + sys.stderr.write("{} {}:{}".format(prepend, self.program, argv))
622 - def printStatusErr4xx(self, status_code,*argv,noprog=False, prepend="",**kwargs):
623 + def printStatusErr4xx(self, status_code):
626 if( status_code < 400 ):
627 diff --git a/setup.py b/setup.py
628 index d37d099..481f429 100644
632 from setuptools import setup
636 this_directory = path.abspath(path.dirname(__file__))
637 with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: