@classmethod
  def update_deployment(cls, deployment_type, nodes, deployment_id):
    """ Updates the deployment on the AppScale Portal.

    Args:
      deployment_type: A string designating the type of deployment.
      nodes: A list containing the nodes layout.
      deployment_id: A string containing the deployment ID.
    Returns:
      A dictionary containing the updated deployment info.
    Raises:
      AppScaleException if the deployment ID is invalid or already registered.
    """
    # Remove unneeded info from node layout.
    for node in nodes:
      if 'ssh_key' in node:
        del node['ssh_key']

    deployment_data = urllib.urlencode({
      'deployment_type': deployment_type,
      'node_layout': json.dumps(nodes),
      'appscale_version': APPSCALE_VERSION
    })
    try:
      response = urllib2.urlopen(
        cls.DEPLOYMENTS_URL.format(deployment_id), data=deployment_data)
      deployment = response.read()
      return json.loads(deployment)
    except urllib2.HTTPError as error:
      if error.code == cls.HTTP_NOTFOUND:
        raise AppScaleException('This deployment ID does not exist.')
      if error.code == cls.HTTP_METHODNOTALLOWED:
        raise AppScaleException('This feature is currently unavailable.')
      if error.code == cls.HTTP_BADREQUEST:
        raise AppScaleException(error.read())
dataset/ETHPy150Open AppScale/appscale-tools/lib/registration_helper.py/RegistrationHelper.update_deployment/original