Skip to content

Commit

Permalink
revert: boto user agent (#1707)
Browse files Browse the repository at this point in the history
Why is this change necessary?

* Need to decide if this the best way to do this in the future.

How does it address the issue?

* Removes extra user agent information from boto calls.

What side effects does this change have?

* None
  • Loading branch information
sriram-mv committed Jan 3, 2020
1 parent ff04d75 commit 2988643
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
6 changes: 1 addition & 5 deletions samcli/commands/deploy/deploy_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from samcli.commands.deploy import exceptions as deploy_exceptions
from samcli.lib.deploy.deployer import Deployer
from samcli.lib.package.s3_uploader import S3Uploader
from samcli.lib.utils.botoconfig import get_boto_config_with_user_agent
from samcli.yamlhelper import yaml_parse

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -103,10 +102,7 @@ def run(self):
raise deploy_exceptions.DeployBucketRequiredError()

session = boto3.Session(profile_name=self.profile if self.profile else None)
config = get_boto_config_with_user_agent()
cloudformation_client = session.client(
"cloudformation", region_name=self.region if self.region else None, config=config
)
cloudformation_client = session.client("cloudformation", region_name=self.region if self.region else None)

s3_client = None
if self.s3_bucket:
Expand Down
7 changes: 2 additions & 5 deletions samcli/commands/package/package_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

import boto3
import click
from botocore.config import Config

from samcli.commands.package.exceptions import PackageFailedError
from samcli.lib.package.artifact_exporter import Template
from samcli.lib.package.s3_uploader import S3Uploader
from samcli.lib.utils.botoconfig import get_boto_config_with_user_agent
from samcli.yamlhelper import yaml_dump

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -81,10 +81,7 @@ def run(self):

session = boto3.Session(profile_name=self.profile if self.profile else None)
s3_client = session.client(
"s3",
config=get_boto_config_with_user_agent(
signature_version="s3v4", region_name=self.region if self.region else None
),
"s3", config=Config(signature_version="s3v4", region_name=self.region if self.region else None)
)

self.s3_uploader = S3Uploader(s3_client, self.s3_bucket, self.s3_prefix, self.kms_key_id, self.force_upload)
Expand Down
17 changes: 0 additions & 17 deletions samcli/lib/utils/botoconfig.py

This file was deleted.

0 comments on commit 2988643

Please sign in to comment.