google / cloud-forensics-utils

Python library to carry out DFIR analysis on the Cloud
Apache License 2.0
454 stars 88 forks source link

Fix deleteinstance command line function #274

Closed giovannt0 closed 3 years ago

giovannt0 commented 3 years ago

Fix #273

~/(venv) giovannt0@: cloudforensics gcp <project_id> deleteinstance instance-1 --delete_all_disks
[2020-12-17 14:31:25,239] [libcloudforensics.providers.gcp.internal.compute] INFO     project:<project_id> Deleting Instance: instance-1
[2020-12-17 14:31:43,852] [libcloudforensics.providers.gcp.internal.compute] ERROR    Disk instance-1 was not found in project <project_id>
[2020-12-17 14:31:43,852] [libcloudforensics.providers.gcp.internal.compute] INFO     project:<project_id> Could not find disk: instance-1, skipping
Instance deleted.

Despite the logging, the instance and its disk are now deleted as expected. Alternatively we could filter out already deleted disks from the disks_to_delete list to prevent ResourceNotFoundError from being thrown in the first place.

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

giovannt0 commented 3 years ago

@googlebot I signed it!

google-cla[bot] commented 3 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 3 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

hacktobeer commented 3 years ago

And have a lovely Christmas/NYE Theo!

giovannt0 commented 3 years ago

Thank you @hacktobeer, you as well!

codecov-io commented 3 years ago

Codecov Report

Merging #274 (a817e9a) into master (e4448c6) will increase coverage by 0.63%. The diff coverage is 67.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #274      +/-   ##
==========================================
+ Coverage   65.39%   66.03%   +0.63%     
==========================================
  Files          14       29      +15     
  Lines         968     2102    +1134     
==========================================
+ Hits          633     1388     +755     
- Misses        335      714     +379     
Flag Coverage Δ
nosetests 66.03% <67.89%> (+0.63%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...cloudforensics/providers/azure/internal/network.py 24.52% <24.52%> (ø)
libcloudforensics/providers/gcp/forensics.py 40.20% <33.33%> (-24.80%) :arrow_down:
libcloudforensics/providers/aws/internal/kms.py 40.00% <40.00%> (ø)
...ibcloudforensics/providers/gcp/internal/compute.py 53.97% <50.77%> (-8.39%) :arrow_down:
libcloudforensics/providers/aws/forensics.py 56.16% <53.06%> (-13.61%) :arrow_down:
...cs/providers/gcp/internal/compute_base_resource.py 37.33% <54.28%> (+0.82%) :arrow_up:
libcloudforensics/providers/aws/internal/log.py 73.07% <55.55%> (-4.20%) :arrow_down:
libcloudforensics/providers/gcp/internal/common.py 56.89% <57.44%> (+0.57%) :arrow_up:
...bcloudforensics/providers/gcp/internal/function.py 40.54% <62.50%> (+8.28%) :arrow_up:
...loudforensics/providers/azure/internal/resource.py 65.38% <65.38%> (ø)
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ae54d11...a817e9a. Read the comment docs.