Skip to content

Commit 94c73a5

Browse files
committed
Lint
1 parent 7bc5896 commit 94c73a5

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

libcloudforensics/providers/gcp/forensics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ def VMRemoveServiceAccount(
475475
# Get the initial powered state of the instance
476476
initial_state = instance.GetPowerState()
477477

478-
if not initial_state in valid_starting_states:
478+
if initial_state not in valid_starting_states:
479479
logger.error(
480480
'Instance "{0:s}" is currently {1:s} which is an invalid '
481481
'state for this operation'.format(instance_name, initial_state))
482482
return False
483483

484484
try:
485485
# Stop the instance if it is not already (or on the way)....
486-
if not initial_state in ('TERMINATED', 'STOPPING'):
486+
if initial_state not in ('TERMINATED', 'STOPPING'):
487487
instance.Stop()
488488

489489
# Remove the service account

libcloudforensics/providers/gcp/internal/compute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def _GetResourceFromComputeApi(
162162
"""
163163
client = getattr(self.GceApi(), resource_type)()
164164
if zone or region:
165-
param_name = resource_type[:-1] if resource_type.endswith('s') else resource_type
165+
param_name = resource_type[:-1] if resource_type.endswith(
166+
's') else resource_type
166167
if resource_type == 'instanceGroupManagers':
167168
param_name = 'instanceGroupManager'
168169
elif resource_type == 'regionDisks':

tests/providers/gcp/gcp_mocks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
'projects/fake-target-project/logs/OSConfigAgent'
7575
]
7676

77+
# pylint: disable=line-too-long
7778
FAKE_DISK_LIST = [
7879
{
7980
'name':
@@ -92,6 +93,7 @@
9293
'0123456789012345678'
9394
}
9495
]
96+
# pylint: enable=line-too-long
9597

9698
STARTUP_SCRIPT = 'scripts/startup.sh'
9799

tests/providers/gcp/internal/test_compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,13 @@ def testGetDisk(self, mock_get_operation, mock_get_disk):
564564
"""Test that a disk is retrieved by its name, if existing."""
565565
mock_get_operation.return_value = gcp_mocks.MOCK_GCE_OPERATION_INSTANCES_GET
566566
mock_get_disk.return_value = gcp_mocks.FAKE_DISK
567-
567+
568568
# Normal disk
569569
disk = gcp_mocks.FAKE_INSTANCE.GetDisk(gcp_mocks.FAKE_DISK.name)
570570
self.assertIsInstance(disk, compute.GoogleComputeDisk)
571571
self.assertEqual('fake-disk', disk.name)
572572
mock_get_disk.assert_called_with(disk_name='fake-disk', zone='fake-zone')
573-
573+
574574
# Boot disk
575575
mock_get_disk.return_value = gcp_mocks.FAKE_BOOT_DISK
576576
disk = gcp_mocks.FAKE_INSTANCE.GetDisk(gcp_mocks.FAKE_BOOT_DISK.name)

0 commit comments

Comments
 (0)