Skip to content
Closed
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
3 changes: 2 additions & 1 deletion awscli/customizations/ecs/executecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import logging
import json
import errno
import os

from subprocess import check_call
from awscli.compat import ignore_user_entered_signals
Expand Down Expand Up @@ -83,7 +84,7 @@ def invoke(self, service_name, operation_name, parameters, parsed_globals):
# before calling execute-command to ensure that
# session-manager-plugin is installed
# before execute-command-command is made
check_call(["session-manager-plugin"])
check_call(["session-manager-plugin"], stdout=open(os.devnull, 'wb'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about simplifying this to just use subprocess.DEVNULL (and importing DEVNULL from subprocess up at the top)?

Suggested change
check_call(["session-manager-plugin"], stdout=open(os.devnull, 'wb'))
check_call(["session-manager-plugin"], stdout=DEVNULL)

client = self._session.create_client(
service_name, region_name=parsed_globals.region,
endpoint_url=parsed_globals.endpoint_url,
Expand Down