Commit 1483774b authored by nimrod's avatar nimrod
Browse files

- Renamed Python module to eb_prune (otherwise import fails).

- Added log files and .tox to gitignore.
- Beginning work on README file (just heading, single note and TODO list for
  now).
- Added MANIFEST.in.
- Refactored code in to a main function (for console script).
- Added setup.cfg.
- Specify Python 3.5 and 2.7 (what I have available locally for testing).
- Added dependency list.
parent 3edbdf7b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8,3 +8,5 @@ build/
dist/
*.egg-info/
__pycache__/
*.log
.tox

MANIFEST.in

0 → 100644
+1 −0
Original line number Diff line number Diff line
recursive-include eb-prune
+13 −0
Original line number Diff line number Diff line
eb-prune
########

Must specify AWS_DEFAULT_REGION environment variable.

TODO
----

- License.
- Changelog.
- README,
- Testing with different Python versions with tox and flake8.
- Specify number of versions to keep.
+7 −3
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@ from __future__ import (absolute_import, division,
from botocore import session


if __name__ == '__main__':
def main():
    print('Pruning Elastic Beanstalk versions.')
    session = session.get_session()
    beanstalk_client = session.create_client('elasticbeanstalk')
    aws_session = session.get_session()
    beanstalk_client = aws_session.create_client('elasticbeanstalk')
    response = beanstalk_client.describe_application_versions()
    if response['ResponseMetadata']['HTTPStatusCode'] != 200:
        raise RuntimeError('Failed to describe application versions.')
@@ -34,3 +34,7 @@ if __name__ == '__main__':
        print('Deleted version {0} of {1}.'.format(version['VersionLabel'],
              version['ApplicationName']))
    print('Deleted {0} versions.'.format(len(old_versions)))


if __name__ == '__main__':
    main()

setup.cfg

0 → 100644
+5 −0
Original line number Diff line number Diff line
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
Loading