Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion utils/cloud_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import types
import os
import re
import socket

# 3rd party
Expand Down Expand Up @@ -198,12 +199,17 @@ def get_tags(agentConfig):

import boto.ec2
proxy_settings = get_proxy(agentConfig) or {}

proxy_host = proxy_settings.get('host')
if proxy_host is not None:
proxy_host = re.sub(r'^http(s?)://', '', proxy_host)

connection = boto.ec2.connect_to_region(
region,
aws_access_key_id=iam_params['AccessKeyId'],
aws_secret_access_key=iam_params['SecretAccessKey'],
security_token=iam_params['Token'],
proxy=proxy_settings.get('host'), proxy_port=proxy_settings.get('port'),
proxy=proxy_host, proxy_port=proxy_settings.get('port'),
proxy_user=proxy_settings.get('user'), proxy_pass=proxy_settings.get('password')
)

Expand Down