Beispiel #1
0
  def _downloadprogress(self):
    url = urlparse(self._progressurl)
    connection = httputils.getverifiedconnection(url=url, timeout=5)

    try:
      connection.request('GET', '%s?clientid=%s' % (url.path, self._clientid))
      data = connection.getresponse().read()
      logger.debug('Dati di progress ricevuti: %s' % data)
      xml = parseString(data)
    except Exception as e:
      logger.error('Impossibile scaricare il progress xml. Errore: %s.' % e)
      raise Exception('Impossibile scaricare il progress xml. Errore: %s.' % e)
    
    return xml
Beispiel #2
0
  def _download(self):
    #logger.debug('Reading resource %s for client %s' % (self._scheduler, self._client))

    url = urlparse(self._scheduler)
    certificate = self._client.isp.certificate
    connection = httputils.getverifiedconnection(url = url, certificate = certificate, timeout = self._httptimeout)

    try:
      connection.request('GET', '%s?clientid=%s&version=%s&confid=%s' % (url.path, self._client.id, __version__, self._md5conf))
      data = connection.getresponse().read()
    except Exception as e:
      logger.error('Impossibile scaricare lo scheduling. Errore: %s.' % e)
      self._updatestatus(Status(status.ERROR, 'Impossibile dialogare con lo scheduler delle misure.'))
      return None

    return xml2task(data)