Skip to content

Commit

Permalink
issue #51 - even more debugging on spot instance requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Jul 30, 2016
1 parent e7081d7 commit cf9195c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions awslimitchecker/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ def show_usage(self):
for lim in sorted(limits[svc].keys()):
data["{s}/{l}".format(s=svc, l=lim)] = '{v}'.format(
v=limits[svc][lim].get_current_usage_str())
if lim == 'Max spot instance requests per region':
logger.debug(
'"Max spot instance requests per region" limit (%s): '
'%s', limits[svc][lim], vars(limits[svc][lim]))
for u in limits[svc][lim].get_current_usage():
logger.debug("spot requests current usage %s - %s",
u, vars(u))
print(dict2cols(data))

def color_output(self, s, color):
Expand Down
4 changes: 3 additions & 1 deletion awslimitchecker/services/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def _find_usage_spot_instances(self):
logger.debug('NOT counting spot instance request %s state=%s',
req['SpotInstanceRequestId'], req['State'])
logger.debug('Setting "Max spot instance requests per region" limit '
'current usage to: %d', count)
'(%s) current usage to: %d',
self.limits['Max spot instance requests per region'],
count)
self.limits['Max spot instance requests per region']._add_current_usage(
count,
aws_type='AWS::EC2::SpotInstanceRequest'
Expand Down

0 comments on commit cf9195c

Please sign in to comment.