akirsman / Snapshots

Utilities for EBS Snapshots
12 stars 6 forks source link

Not working in 2023 :( #3

Open Carlos-mb opened 1 year ago

Carlos-mb commented 1 year ago

Hi... I suppose this is discontinued, but I want to report that it's not working now.

It requires the region on boto3.client

I have been able to find it, adding this boto3.client(ebs/ec2, region_name='xxxxx')

But now is reporting a new error and I have no knowledge to fix it:

File "./snapshotsize.py", line 10, in snapshots = ec2.describe_snapshots(OwnerIds=['self']) File "/usr/lib/fence-agents/bundled/botocore/client.py", line 391, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/lib/fence-agents/bundled/botocore/client.py", line 706, in _make_api_call operation_model, request_dict, request_context) File "/usr/lib/fence-agents/bundled/botocore/client.py", line 725, in _make_request return self._endpoint.make_request(operation_model, request_dict) File "/usr/lib/fence-agents/bundled/botocore/endpoint.py", line 104, in make_request return self._send_request(request_dict, operation_model) File "/usr/lib/fence-agents/bundled/botocore/endpoint.py", line 134, in _send_request request = self.create_request(request_dict, operation_model) File "/usr/lib/fence-agents/bundled/botocore/endpoint.py", line 118, in create_request operation_name=operation_model.name) File "/usr/lib/fence-agents/bundled/botocore/hooks.py", line 357, in emit return self._emitter.emit(aliased_event_name, kwargs) File "/usr/lib/fence-agents/bundled/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/usr/lib/fence-agents/bundled/botocore/hooks.py", line 211, in _emit response = handler(kwargs) File "/usr/lib/fence-agents/bundled/botocore/signers.py", line 93, in handler return self.sign(operation_name, request) File "/usr/lib/fence-agents/bundled/botocore/signers.py", line 165, in sign auth.add_auth(request) File "/usr/lib/fence-agents/bundled/botocore/auth.py", line 380, in add_auth raise NoCredentialsError()

Thanks for your effort :)

Regards

Hummdis commented 10 months ago

I got mine to work using Python v3.9.

First, change the import line:

from pandas.io.json import json_normalize

To this:

from pandas import json_normalize

Then, like you said, you need to add , region_name='ec2-region-name' to the boto3 parameters, like so:

ebs = boto3.client('ebs', region_name='us-east-2')
ec2 = boto3.client('ec2', region_name='us-east-2')

Then it works for me.