Changeset f069052 for fedd/fedd_client.py
- Timestamp:
- Nov 30, 2008 5:38:16 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 05191a6
- Parents:
- edbc841
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_client.py
redbc841 rf069052 4 4 import os 5 5 import pwd 6 7 from fedd.fedd_services import *8 from fedd.fedd_internal_services import *9 6 10 7 from fedd import fedid, service_error … … 177 174 Specialize the class for the pre method 178 175 """ 179 self.RequestMessage = globals()["%sRequestMessage" % pre]180 self.ResponseMessage = globals()["%sResponseMessage" % pre]181 176 self.RequestBody="%sRequestBody" % pre 182 177 self.ResponseBody="%sResponseBody" % pre 183 178 self.method = pre 184 179 185 method_call = getattr(feddServiceLocator().getfeddPortType(), 186 self.method, None) 187 if method_call: 188 # The pre method is a fedd external service 189 self.caller = service_caller(self.method, 'getfeddPortType', 190 feddServiceLocator, self.RequestMessage, self.RequestBody) 191 else: 192 # The pre method is a fedd internal service 193 self.caller = service_caller(self.method, 194 'getfeddInternalPortType', feddInternalServiceLocator, 195 self.RequestMessage, self.RequestBody) 196 180 self.caller = service_caller(self.method) 197 181 self.RPCException = fedd_rpc.RPCException 198 182 … … 255 239 try: 256 240 context = fedd_ssl_context(cert, trusted) 257 except SSL.SSLError, e:241 except Exception, e: 258 242 # Yes, doing this on message type is not ideal. The string 259 243 # comes from OpenSSL, so check there is this stops working. … … 343 327 (opts, args) = parser.parse_args() 344 328 345 if opts.trusted != None:329 if opts.trusted: 346 330 if ( not os.access(opts.trusted, os.R_OK) ) : 347 331 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted) 348 else:349 parser.error("--trusted is required")350 332 351 333 if opts.debug > 0: opts.tracefile=sys.stderr … … 411 393 (opts, args) = parser.parse_args() 412 394 413 if opts.trusted != None:395 if opts.trusted: 414 396 if ( not os.access(opts.trusted, os.R_OK) ) : 415 397 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted) 416 else:417 parser.error("--trusted is required")418 398 419 399 if opts.debug > 0: opts.tracefile=sys.stderr … … 471 451 (opts, args) = parser.parse_args() 472 452 473 if opts.trusted != None:453 if opts.trusted: 474 454 if ( not os.access(opts.trusted, os.R_OK) ) : 475 455 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted) 476 else:477 parser.error("--trusted is required")478 456 479 457 if not opts.project : … … 568 546 (opts, args) = parser.parse_args() 569 547 570 if opts.trusted != None:548 if opts.trusted: 571 549 if ( not os.access(opts.trusted, os.R_OK) ) : 572 550 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted) 573 else:574 parser.error("--trusted is required")575 551 576 552 if opts.debug > 0: opts.tracefile=sys.stderr … … 674 650 parser.error("--testbed is required") 675 651 676 if opts.trusted != None:652 if opts.trusted: 677 653 if ( not os.access(opts.trusted, os.R_OK) ) : 678 654 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted) 679 else:680 parser.error("--trusted is required")681 655 682 656 if opts.debug > 0: opts.tracefile=sys.stderr
Note: See TracChangeset
for help on using the changeset viewer.