Example #1
0
AWSSession AWSSessionRecord_Impl::awsSession() const {
    OptionalUrl serverUrl;
    std::string serverId;
    if (OptionalUrlRecord sur = serverUrlRecord()) {
        serverUrl = sur->url();
        serverId = sur->name();
    }
    UrlVector workerUrls;
    StringVector workerIds;
    for (const UrlRecord& wur : workerUrlRecords()) {
        workerUrls.push_back(wur.url());
        workerIds.push_back(wur.name());
    }
    return AWSSession(handle(),
                      uuidLast(),
                      sessionId(),
                      serverUrl,
                      serverId,
                      m_numServerProcessors,
                      workerUrls,
                      workerIds,
                      m_numWorkerProcessors,
                      m_privateKey,
                      m_timestamp,
                      m_region,
                      m_serverInstanceType,
                      m_workerInstanceType);
}
Example #2
0
static UrlVector localhost_only(const UrlVector& input)
{
  UrlVector result;
  result.reserve(input.size());
  for (const auto& url: input)
  {
    if (isLocalHost(url.host()))
      result.push_back(url);
  }
  return result;
}
static UrlVector localhost_only(const UrlVector& input)
{
  UrlVector result;

  result.reserve(input.size());
  for (UrlVector::const_iterator it = input.begin(), end = input.end(); it != end; ++it)
  {
    const std::string& host = it->host();
    if (boost::algorithm::starts_with(host, "127.") || host == "localhost")
      result.push_back(*it);
  }
  return result;
}
 VagrantSession VagrantSessionRecord_Impl::vagrantSession() const {
   OptionalUrl serverUrl;
   if (OptionalUrlRecord sur = serverUrlRecord()) {
     serverUrl = sur->url();
   }
   UrlVector workerUrls;
   for (const UrlRecord& wur : workerUrlRecords()) {
     workerUrls.push_back(wur.url());
   }
   return VagrantSession(handle(),
                         uuidLast(),
                         sessionId(),
                         serverUrl,
                         workerUrls);
 }