diff --git a/EC2/ec2_get_console_screenshot.py b/EC2/ec2_get_console_screenshot.py index e6fbd6f7..49327c39 100644 --- a/EC2/ec2_get_console_screenshot.py +++ b/EC2/ec2_get_console_screenshot.py @@ -1,13 +1,12 @@ """ Retrieve a JPG-format screenshot of a running instance to help with troubleshooting. """ -import click import logging import os +import click from helper.aws import AwsApiHelper, get_tag_value - logging.getLogger().setLevel(logging.DEBUG) OUTPUT_DIR = "ec2_console_screentshots" @@ -18,7 +17,7 @@ class Helper(AwsApiHelper): def __init__(self): super().__init__() - + def process_request(self, session, account_id, region, kwargs): client = session.client("ec2", region_name=region) for item in self.paginate(client, "describe_instances", kwargs): @@ -43,7 +42,7 @@ def process_client_error(self, e, account_id, region): @click.command() @click.option("--instanceid", "-i", help="EC2 instance ID. Describe all instances if not specified.") @click.option("--profile", "-p", help="AWS profile name. Use profiles in ~/.aws if not specified.") -@click.option("--region", "-r", default="ap-southeast-2", show_default=True, help="AWS Region. Use "all" for all regions.") +@click.option("--region", "-r", default="ap-southeast-2", show_default=True, help="AWS Region. Use `all` for all regions.") def main(instanceid, profile, region): kwargs = {"InstanceIds": [instanceid]} if instanceid else {} Helper().start(profile, region, "ec2", kwargs)