bonclay7 / aws-amicleaner

Cleanup your old unused ami and related snapshots
MIT License
362 stars 132 forks source link

Fix support for Python 2.7 #94

Open dmitry-mukhin opened 6 years ago

dmitry-mukhin commented 6 years ago

before

✗ amicleaner --help
Traceback (most recent call last):
  File "bin/amicleaner", line 7, in <module>
    from amicleaner.cli import main
  File "envs/x/lib/python2.7/site-packages/amicleaner/cli.py", line 6, in <module>
    from builtins import input
ImportError: No module named builtins

after

✗ amicleaner --help 
usage: amicleaner [-h] [-v] [--from-ids FROM_IDS [FROM_IDS ...]]
                  [--full-report] [--mapping-key MAPPING_KEY]
                  [--mapping-values MAPPING_VALUES [MAPPING_VALUES ...]]
                  [--excluded-mapping-values EXCLUDED_MAPPING_VALUES [EXCLUDED_MAPPING_VALUES ...]]
                  [--keep-previous KEEP_PREVIOUS] [-f] [--check-orphans]
                  [--ami-min-days AMI_MIN_DAYS]

Clean your AMIs on your AWS account. Your AWS credentials must be sourced

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Prints version and exits
  --from-ids FROM_IDS [FROM_IDS ...]
                        AMI id(s) you simply want to remove
  --full-report         Prints a full report of what to be cleaned
  --mapping-key MAPPING_KEY
                        How to regroup AMIs : [name|tags]
  --mapping-values MAPPING_VALUES [MAPPING_VALUES ...]
                        List of values for tags or name
  --excluded-mapping-values EXCLUDED_MAPPING_VALUES [EXCLUDED_MAPPING_VALUES ...]
                        List of values to be excluded from tags
  --keep-previous KEEP_PREVIOUS
                        Number of previous AMI to keep excluding those
                        currently being running
  -f, --force-delete    Skip confirmation
  --check-orphans       Check and clean orphaned snapshots
  --ami-min-days AMI_MIN_DAYS
                        Number of days AMI to keep excluding those currently
                        being running