Checks if the fleet['SpotFleetRequestConfig'] also contains the LaunchSpecifications key using get() instead of assuming it contains this key
Original traceback
Traceback (most recent call last):
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/bin/awslimitchecker", line 8, in <module>
sys.exit(console_entry_point())
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/runner.py", line 550, in console_entry_point
r.console_entry_point()
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/runner.py", line 492, in console_entry_point
self.show_usage()
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/runner.py", line 318, in show_usage
self.checker.find_usage(
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/checker.py", line 433, in find_usage
cls.find_usage()
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/services/ec2.py", line 126, in find_usage
self._find_usage_spot_fleets()
File "/Users/snip/.local/share/virtualenvs/awslimitchecker-IqjcCELy/lib/python3.9/site-packages/awslimitchecker/services/ec2.py", line 252, in _find_usage_spot_fleets
fleet['SpotFleetRequestConfig']['LaunchSpecifications'])
KeyError: 'LaunchSpecifications'
Pull Request Checklist
[x] All pull requests should be against the develop branch, not master.
[x] All pull requests must include the Contributor License Agreement (see below).
[x] Whether or not your PR includes unit tests:
[x] Please make sure you have run the exact code contained in the PR locally, and it functions as desired.
[x] Please make sure the TravisCI build passes or, if not, you've corrected any obvious problems identified by the tests.
[x] pep8 compliant with some exceptions (see pytest.ini)
[x] 100% test coverage with pytest (with valid tests). If you have difficulty
writing tests for the code, that's fine, just mention that in the summary and either
ask for assistance, or clarify that you'd like someone else to handle the tests. PRs that
include complete test coverage will usually be merged faster.
[x] Complete, correctly-formatted documentation for all classes, functions and methods.
[x] documentation has been rebuilt with tox -e docs
[x] Connections to the AWS services should only be made by the class's
connect() and connect_resource() methods, inherited from
awslimitchecker.connectable.Connectable
[x] All modules should have (and use) module-level loggers.
[x] Commit messages should be meaningful, and reference the Issue number
if you're working on a GitHub issue (i.e. "issue #x - "). Please
refrain from using the "fixes #x" notation unless you are sure that the
the issue is fixed in that commit.
[x] Git history is fully intact; please do not squash or rewrite history.
Contributor License Agreement
By submitting this work for inclusion in awslimitchecker, I agree to the following terms:
The contribution included in this request (and any subsequent revisions or versions of it)
is being made under the same license as the awslimitchecker project (the Affero GPL v3,
or any subsequent version of that license if adopted by awslimitchecker).
My contribution may perpetually be included in and distributed with awslimitchecker; submitting
this pull request grants a perpetual, global, unlimited license for it to be used and distributed
under the terms of awslimitchecker's license.
I have the legal power and rights to agree to these terms.
Summary
fleet['SpotFleetRequestConfig']
also contains theLaunchSpecifications
key usingget()
instead of assuming it contains this keyOriginal traceback
Pull Request Checklist
tox -e docs
connect()
andconnect_resource()
methods, inherited from awslimitchecker.connectable.ConnectableContributor License Agreement
By submitting this work for inclusion in awslimitchecker, I agree to the following terms: