Changeset 5486

Show
Ignore:
Timestamp:
05/21/12 23:05:02 (7 years ago)
Author:
sushant
Message:

Replace all occurrences of SeattleGENI*Error. Refs #1055

Location:
seattle/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/experimentmanager/examples/seattlegeni_maintain_vessels.py

    r5483 r5486  
    9292      try: 
    9393        experimentlib.seattlegeni_release_vessels(identity, vesselhandles_to_release) 
    94       except experimentlib.SeattleGENIError, e: 
     94      except experimentlib.SeattleClearinghouseError, e: 
    9595        print("Failed to release vessels: " + str(e)) 
    9696      else: 
     
    120120    print("Acquired " + str(num_vessels_to_request) + " vessels: " + str(acquired_vessels)) 
    121121 
    122   except experimentlib.SeattleGENIError, e: 
     122  except experimentlib.SeattleClearinghouseError, e: 
    123123    # This isn't very useful error handling, but is here to demonstrate catching 
    124124    # errors raised by the seattlegeni_* functions of the experimentlib. 
  • seattle/trunk/experimentmanager/experimentlib.py

    r5485 r5486  
    8383    All exceptions raised by functions in this module will either be or extend: 
    8484      * SeattleExperimentError 
    85       * SeattleGENIError 
     85      * SeattleClearinghouseError 
    8686       
    87     The SeattleGENIError* exceptions will only be raised by the functions whose 
     87    The SeattleClearinghouseError* exceptions will only be raised by the functions whose 
    8888    names are seattlegeni_*. Any of the seattlegeni_* functions may raise the 
    8989    following in addition to specific exceptions described in the function 
    90     docstrings (these are all subclasses of SeattleGENIError): 
    91       * SeattleGENICommunicationError 
    92       * SeattleGENIAuthenticationError 
    93       * SeattleGENIInvalidRequestError 
    94       * SeattleGENIInternalError 
     90    docstrings (these are all subclasses of SeattleClearinghouseError): 
     91      * SeattleClearinghouseCommunicationError 
     92      * SeattleClearinghouseAuthenticationError 
     93      * SeattleClearinghouseInvalidRequestError 
     94      * SeattleClearinghouseInternalError 
    9595       
    9696    In the case of invalid arguments to functions, the following may be 
     
    272272#in the namespace of the experimentlib so that clients do not have to import 
    273273#seattleclearinghouse_xmlrpc to catch these. 
    274 SeattleGENIError = seattleclearinghouse_xmlrpc.SeattleGENIError 
     274SeattleClearinghouseError = seattleclearinghouse_xmlrpc.SeattleClearinghouseError 
    275275 
    276276# We make these available, as well, in case users find them useful. We prefix 
    277277# all of these error names with SeattleGENI. 
    278 SeattleGENICommunicationError = seattleclearinghouse_xmlrpc.CommunicationError 
    279 SeattleGENIInternalError = seattleclearinghouse_xmlrpc.InternalError 
    280 SeattleGENIAuthenticationError = seattleclearinghouse_xmlrpc.AuthenticationError 
    281 SeattleGENIInvalidRequestError = seattleclearinghouse_xmlrpc.InvalidRequestError 
    282 SeattleGENINotEnoughCreditsError = seattleclearinghouse_xmlrpc.NotEnoughCreditsError 
    283 SeattleGENIUnableToAcquireResourcesError = seattleclearinghouse_xmlrpc.UnableToAcquireResourcesError 
     278SeattleClearinghouseCommunicationError = seattleclearinghouse_xmlrpc.CommunicationError 
     279SeattleClearinghouseInternalError = seattleclearinghouse_xmlrpc.InternalError 
     280SeattleClearinghouseAuthenticationError = seattleclearinghouse_xmlrpc.AuthenticationError 
     281SeattleClearinghouseInvalidRequestError = seattleclearinghouse_xmlrpc.InvalidRequestError 
     282SeattleClearinghouseNotEnoughCreditsError = seattleclearinghouse_xmlrpc.NotEnoughCreditsError 
     283SeattleClearinghouseUnableToAcquireResourcesError = seattleclearinghouse_xmlrpc.UnableToAcquireResourcesError 
    284284 
    285285 
     
    15731573  """ 
    15741574  Helper function to limit the potential errors raised by seattlegeni_* 
    1575   functions to SeattleGENIError or classes that extend it. The seattleclearinghouse_xmlrpc 
     1575  functions to SeattleClearinghouseError or classes that extend it. The seattleclearinghouse_xmlrpc 
    15761576  module doesn't catch ProtocolError or unexpected xmlrpc faults. At the level 
    15771577  of the experimentlib, though, we just consider these generic failures for the 
     
    15811581    return func(*args, **kwargs) 
    15821582  except xmlrpclib.ProtocolError: 
    1583     raise SeattleGENIError("Failed to communicate with SeattleGENI. " + 
     1583    raise SeattleClearinghouseError("Failed to communicate with SeattleGENI. " + 
    15841584                           "Are you using the correct xmlrpc url? " + traceback.format_exc()) 
    15851585  except xmlrpclib.Fault: 
    1586     raise SeattleGENIError("Unexpected XML-RPC fault when talking to SeattleGENI. " + 
     1586    raise SeattleClearinghouseError("Unexpected XML-RPC fault when talking to SeattleGENI. " + 
    15871587                           "Are you using a current version of experimentlib.py and " + 
    15881588                           "seattleclearinghouse_xmlrpc.py? " + traceback.format_exc()) 
     
    16451645  <Exceptions> 
    16461646    The common SeattleGENI exceptions described in the module comments, as well as: 
    1647     SeattleGENINotEnoughCreditsError 
     1647    SeattleClearinghouseNotEnoughCreditsError 
    16481648      If the account does not have enough available vessel credits to fulfill 
    16491649      the request. 
     
    16781678  <Exceptions> 
    16791679    The common SeattleGENI exceptions described in the module comments, as well as: 
    1680     SeattleGENINotEnoughCreditsError 
     1680    SeattleClearinghouseNotEnoughCreditsError 
    16811681      If the account does not have enough available vessel credits to fulfill 
    16821682      the request. 
  • seattle/trunk/overlord/overlord.py

    r4480 r5486  
    443443      vessel_handlers = explib.seattlegeni_acquire_vessels(self.config['identity'], self.config['vessel_type'], vessel_count) 
    444444     
    445     except explib.SeattleGENIError, e: 
     445    except explib.SeattleClearinghouseError, e: 
    446446      self.logger.error('Error while acquiring vessels: ' + str(e)) 
    447447      return [] 
     
    588588    try: 
    589589      explib.seattlegeni_release_vessels(self.config['identity'], vessel_handlers) 
    590     except explib.SeattleGENIError, e: 
     590    except explib.SeattleClearinghouseError, e: 
    591591      self.logger.error('Error while releasing vessels: ' + str(e)) 
    592592 
  • seattle/trunk/production_nat_new/src/nmpatch/addme.py

    r5485 r5486  
    140140  The safest way to be certain to catch any of these errors  is to the catch 
    141141  their base class: 
    142     SeattleGENIError 
     142    SeattleClearinghouseError 
    143143     
    144144<Version> 
     
    229229      repyhelper.translate_and_import("rsa.repy") 
    230230    except ImportError, e: 
    231       raise SeattleGENIError("Unable to get API key from SeattleGENI " + 
     231      raise SeattleClearinghouseError("Unable to get API key from SeattleGENI " + 
    232232                             "because a required python or repy module " +  
    233233                             "cannot be found:" + str(e)) 
     
    627627                 M2Crypto.SSL.verify_fail_if_no_peer_cert, depth=9) 
    628628  if ctx.load_verify_locations(ca_certs_file) != 1: 
    629     raise SeattleGENIError("No CA certs found in file: " + ca_certs_file) 
     629    raise SeattleClearinghouseError("No CA certs found in file: " + ca_certs_file) 
    630630 
    631631  return M2CryptoSSLTransport(ctx) 
     
    635635 
    636636 
    637 class SeattleGENIError(Exception): 
     637class SeattleClearinghouseError(Exception): 
    638638  """Base class for exceptions raised by the SeattleGENIClient.""" 
    639639   
    640640 
    641 class CommunicationError(SeattleGENIError): 
     641class CommunicationError(SeattleClearinghouseError): 
    642642  """ 
    643643  Indicates that XMLRPC communication failed. 
     
    645645   
    646646   
    647 class InternalError(SeattleGENIError): 
     647class InternalError(SeattleClearinghouseError): 
    648648  """ 
    649649  Indicates an unexpected error occurred, probably either a bug in this 
     
    652652 
    653653 
    654 class AuthenticationError(SeattleGENIError): 
     654class AuthenticationError(SeattleClearinghouseError): 
    655655  """Indicates an authentication failure (invalid username and/or API key).""" 
    656656  def __init__(self, msg=None): 
    657657    if msg is None: 
    658658      msg = "Authentication failed. Invalid username and/or API key." 
    659     SeattleGENIError.__init__(self, msg) 
    660  
    661  
    662 class InvalidRequestError(SeattleGENIError): 
     659    SeattleClearinghouseError.__init__(self, msg) 
     660 
     661 
     662class InvalidRequestError(SeattleClearinghouseError): 
    663663  """Indicates that the request is invalid.""" 
    664664 
    665665 
    666 class NotEnoughCreditsError(SeattleGENIError): 
     666class NotEnoughCreditsError(SeattleClearinghouseError): 
    667667  """ 
    668668  Indicates that the requested operation requires more vessel credits to 
     
    671671   
    672672   
    673 class UnableToAcquireResourcesError(SeattleGENIError): 
     673class UnableToAcquireResourcesError(SeattleClearinghouseError): 
    674674  """ 
    675675  Indicates that the requested operation failed because SeattleGENI was unable 
  • seattle/trunk/repy/apps/appmap/appmap.py

    r4962 r5486  
    470470 
    471471  # If --insecure switch not used, attempt a secure SSL connection to 
    472   # SeattleGENI. If SeattleGENIError exception thrown, print warning. 
     472  # SeattleGENI. If SeattleClearinghouseError exception thrown, print warning. 
    473473  try: 
    474474    CBFUNC_CONTEXT['geniport'] = experimentlib.seattlegeni_user_port(CBFUNC_CONTEXT['identity']) 
    475475  except Exception, e: 
    476     if repr(e).startswith("SeattleGENIError"): 
     476    if repr(e).startswith("SeattleClearinghouseError"): 
    477477      print """Error: Cannot make secure SSL connection to SeattleGENI 
    478478Please make sure that: 
  • seattle/trunk/seattlegeni/xmlrpc_clients/examples/example1.py

    r5485 r5486  
    8888  try: 
    8989    do_example_acquire_renew_release() 
    90   except seattleclearinghouse_xmlrpc.SeattleGENIError: 
     90  except seattleclearinghouse_xmlrpc.SeattleClearinghouseError: 
    9191    # In a real script, you'd want to handle this. Could be an authentication 
    9292    # error, communication error, etc. You can use the fine-grained exceptions 
    93     # rather than the base exception of SeattleGENIError to do different 
     93    # rather than the base exception of SeattleClearinghouseError to do different 
    9494    # things based on what the actual problem was. 
    9595    raise 
  • seattle/trunk/seattlegeni/xmlrpc_clients/seattleclearinghouse_xmlrpc.py

    r5485 r5486  
    4343  The safest way to be certain to catch any of these errors  is to the catch 
    4444  their base class: 
    45     SeattleGENIError 
     45    SeattleClearinghouseError 
    4646     
    4747<Version> 
     
    135135      repyhelper.translate_and_import("rsa.repy") 
    136136    except ImportError, e: 
    137       raise SeattleGENIError("Unable to get API key from SeattleGENI " + 
     137      raise SeattleClearinghouseError("Unable to get API key from SeattleGENI " + 
    138138                             "because a required python or repy module " +  
    139139                             "cannot be found:" + str(e)) 
     
    533533                 M2Crypto.SSL.verify_fail_if_no_peer_cert, depth=9) 
    534534  if ctx.load_verify_locations(ca_certs_file) != 1: 
    535     raise SeattleGENIError("No CA certs found in file: " + ca_certs_file) 
     535    raise SeattleClearinghouseError("No CA certs found in file: " + ca_certs_file) 
    536536 
    537537  return M2CryptoSSLTransport(ctx) 
     
    541541 
    542542 
    543 class SeattleGENIError(Exception): 
    544   """Base class for exceptions raised by the SeattleGENIClient.""" 
    545    
    546  
    547 class CommunicationError(SeattleGENIError): 
     543class SeattleClearinghouseError(Exception): 
     544  """Base class for exceptions raised by the SeattleClearinghouseClient.""" 
     545   
     546 
     547class CommunicationError(SeattleClearinghouseError): 
    548548  """ 
    549549  Indicates that XMLRPC communication failed. 
     
    551551   
    552552   
    553 class InternalError(SeattleGENIError): 
     553class InternalError(SeattleClearinghouseError): 
    554554  """ 
    555555  Indicates an unexpected error occurred, probably either a bug in this 
     
    558558 
    559559 
    560 class AuthenticationError(SeattleGENIError): 
     560class AuthenticationError(SeattleClearinghouseError): 
    561561  """Indicates an authentication failure (invalid username and/or API key).""" 
    562562  def __init__(self, msg=None): 
    563563    if msg is None: 
    564564      msg = "Authentication failed. Invalid username and/or API key." 
    565     SeattleGENIError.__init__(self, msg) 
    566  
    567  
    568 class InvalidRequestError(SeattleGENIError): 
     565    SeattleClearinghouseError.__init__(self, msg) 
     566 
     567 
     568class InvalidRequestError(SeattleClearinghouseError): 
    569569  """Indicates that the request is invalid.""" 
    570570 
    571571 
    572 class NotEnoughCreditsError(SeattleGENIError): 
     572class NotEnoughCreditsError(SeattleClearinghouseError): 
    573573  """ 
    574574  Indicates that the requested operation requires more vessel credits to 
     
    577577   
    578578   
    579 class UnableToAcquireResourcesError(SeattleGENIError): 
     579class UnableToAcquireResourcesError(SeattleClearinghouseError): 
    580580  """ 
    581581  Indicates that the requested operation failed because SeattleGENI was unable