def get(input_dict, environment_dict):
  """
  <Purpose>
    Gets the specified vessels.

  <Arguments>
    input_dict:  The commanddict representing the user's input.
    environment_dict:  The dictionary representing the current seash
                       environment.

  <Side Effects>
    Connects to the Clearinghouse and acquires vessels.
    Adds the acquired vessels to the list of valid targets.

  <Exceptions>
    None

  <Returns>
    None
  """

  if environment_dict['currentkeyname'] is None or not seash_global_variables.keys[environment_dict['currentkeyname']]['privatekey']:
    raise seash_exceptions.UserError("Error, must get as an identity with a private key")

  # Activate secure mode if user did not specify the insecure keyword
  allow_ssl_insecure = _get_user_argument(input_dict, 'insecure') is not None
  vesselcount = int(_get_user_argument(input_dict, 'vesselcount'))

  try:
    vesseltype = _get_user_argument(input_dict, 'type')
  # User may not have specified a vesseltype
  except IndexError:
    vesseltype = None

  if not vesseltype in ['wan', 'lan', 'nat', None]:
    raise seash_exceptions.UserError("Error, unknown vessel type '"+vesseltype+"'")

  client = _connect_to_clearinghouse(environment_dict['currentkeyname'],
    allow_ssl_insecure)

  # Get the vessels!
  try:
    if vesseltype is None:
      vesseldicts = client.acquire_random_resources(vesselcount)
    else:
      vesseldicts = client.acquire_resources(vesseltype, vesselcount)

    _update_targets(vesseldicts, environment_dict)
  except (seattleclearinghouse_xmlrpc.UnableToAcquireResourcesError, seattleclearinghouse_xmlrpc.NotEnoughCreditsError), e:
    print str(e)
def get ( input_dict , environment_dict ) : if environment_dict [ 'currentkeyname' ] is None or not seash_global_variables . keys [ environment_dict [ 'currentkeyname' ] ] [ 'privatekey' ] : raise seash_exceptions . UserError ( "Error, must get as an identity with a private key" ) allow_ssl_insecure = _get_user_argument ( input_dict , 'insecure' ) is not None vesselcount = int ( _get_user_argument ( input_dict , 'vesselcount' ) ) try : vesseltype = _get_user_argument ( input_dict , 'type' ) except IndexError : vesseltype = None if not vesseltype in [ 'wan' , 'lan' , 'nat' , None ] : raise seash_exceptions . UserError ( "Error, unknown vessel type '" + vesseltype + "'" ) client = _connect_to_clearinghouse ( environment_dict [ 'currentkeyname' ] , allow_ssl_insecure ) try : if vesseltype is None : vesseldicts = client . acquire_random_resources ( vesselcount ) else : vesseldicts = client . acquire_resources ( vesseltype , vesselcount ) _update_targets ( vesseldicts , environment_dict ) except ( seattleclearinghouse_xmlrpc . UnableToAcquireResourcesError , seattleclearinghouse_xmlrpc . NotEnoughCreditsError ) , e : print str ( e )
<Purpose>
    Gets the specified vessels.

  <Arguments>
    input_dict:  The commanddict representing the user's input.
    environment_dict:  The dictionary representing the current seash
                       environment.

  <Side Effects>
    Connects to the Clearinghouse and acquires vessels.
    Adds the acquired vessels to the list of valid targets.

  <Exceptions>
    None

  <Returns>
    None