public function useCDN($cdn) {

    // This should not happen, but has happened when service
    // catalog was bad.
    if (empty($cdn)) {
      throw new \HPCloud\Exception('Cannot use CDN: No CDN provided.');
    }

    $containers = $cdn->containers(TRUE);
    $buffer = array();

    foreach ($containers as $item) {
      // This is needed b/c of a bug in SOS that sometimes
      // returns disabled containers (DEVEX-1733).
      if ($item['cdn_enabled'] == 1) {
        $buffer[$item['name']] = array(
          'url' => $item['x-cdn-uri'],
          'sslUrl' => $item['x-cdn-ssl-uri'],
        );
      }
    }
    $this->cdnContainers = $buffer;

    return $this;
  }