Skip to content

Commit 715596e

Browse files
committed
used black formatter
1 parent 80a3555 commit 715596e

File tree

8 files changed

+30
-17
lines changed

8 files changed

+30
-17
lines changed

cli/src/pcluster/aws/efs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ def describe_access_point(self, access_point_id):
9090
:param efaccess_point_ids_ap_id: EFS access point Id
9191
:return: the access_point details
9292
"""
93-
return self._client.describe_access_points(AccessPointId=access_point_id)
93+
return self._client.describe_access_points(AccessPointId=access_point_id)

cli/src/pcluster/config/cluster_config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,10 @@ def _register_validators(self, context: ValidatorContext = None): # noqa: D102
406406
EfsAccessPointOptionsValidator,
407407
access_point_id=self.access_point_id,
408408
file_system_id=self.file_system_id,
409-
encryption_in_transit=self.encryption_in_transit
409+
encryption_in_transit=self.encryption_in_transit,
410410
)
411411

412+
412413
class BaseSharedFsx(Resource):
413414
"""Represent the shared FSX resource."""
414415

cli/src/pcluster/schemas/cluster_schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def validate_file_system_id_ignored_parameters(self, data, **kwargs):
338338
"encryption_in_transit",
339339
"iam_authorization",
340340
"file_system_id",
341-
"access_point_id"
341+
"access_point_id",
342342
]:
343343
messages.append(EFS_MESSAGES["errors"]["ignored_param_with_efs_fs_id"].format(efs_param=key))
344344
if messages:

cli/src/pcluster/validators/efs_validators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ def _validate(self, encryption_in_transit: bool, iam_authorization: bool, name:
2626
FailureLevel.ERROR,
2727
)
2828

29+
2930
class EfsAccessPointOptionsValidator(Validator):
3031
"""
3132
EFS Mount Options validator.
3233
3334
IAM Authorization requires Encryption in Transit.
3435
"""
3536

36-
def _validate(self, access_point_id: str, file_system_id: str, encryption_in_transit: bool):
37+
def _validate(self, access_point_id: str, file_system_id: str, encryption_in_transit: bool):
3738

3839
if access_point_id and not file_system_id:
3940
self._add_failure(

cli/tests/pcluster/validators/test_efs_validators.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
),
4343
],
4444
)
45-
def test_efs_mount_options_validator(
46-
encryption_in_transit, iam_authorization, expected_message
47-
):
45+
def test_efs_mount_options_validator(encryption_in_transit, iam_authorization, expected_message):
4846
actual_failures = EfsMountOptionsValidator().execute(
4947
encryption_in_transit, iam_authorization, "<name-of-the-file-system>"
5048
)
@@ -82,6 +80,7 @@ def test_efs_access_point_with_filesystem_validator(access_point_id, file_system
8280
actual_failures = EfsAccessPointOptionsValidator().execute(access_point_id, file_system_id, True)
8381
assert_failure_messages(actual_failures, expected_message)
8482

83+
8584
@pytest.mark.parametrize(
8685
"access_point_id, encryption_in_transit, expected_message",
8786
[
@@ -109,5 +108,7 @@ def test_efs_access_point_with_filesystem_validator(access_point_id, file_system
109108
],
110109
)
111110
def test_efs_access_point_with_filesystem_validator(access_point_id, encryption_in_transit, expected_message):
112-
actual_failures = EfsAccessPointOptionsValidator().execute(access_point_id, "<file-system-id>", encryption_in_transit)
113-
assert_failure_messages(actual_failures, expected_message)
111+
actual_failures = EfsAccessPointOptionsValidator().execute(
112+
access_point_id, "<file-system-id>", encryption_in_transit
113+
)
114+
assert_failure_messages(actual_failures, expected_message)

tests/integration-tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,7 @@ def create_efs(num=1):
17851785
for stack in created_stacks:
17861786
cfn_stacks_factory.delete_stack(stack.name, region)
17871787

1788+
17881789
@pytest.fixture(scope="class")
17891790
def efs_access_point_stack_factory(cfn_stacks_factory, request, region, vpc_stack):
17901791
"""EFS stack contains a single efs and a single access point resource."""

tests/integration-tests/tests/storage/storage_common.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,14 @@ def test_raid_correctly_mounted(remote_command_executor, mount_dir, volume_size)
222222

223223

224224
def write_file_into_efs(
225-
region, vpc_stack: CfnVpcStack, efs_ids, request, key_name, cfn_stacks_factory, efs_mount_target_stack_factory, access_point_id=None
225+
region,
226+
vpc_stack: CfnVpcStack,
227+
efs_ids,
228+
request,
229+
key_name,
230+
cfn_stacks_factory,
231+
efs_mount_target_stack_factory,
232+
access_point_id=None,
226233
):
227234
"""Write file stack contains an instance to write an empty file with random name into each of the efs in efs_ids."""
228235
write_file_template = Template()

tests/integration-tests/tests/storage/test_efs.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def test_multiple_efs(
200200
encryption_in_transits,
201201
)
202202

203+
203204
@pytest.mark.usefixtures("instance")
204205
def test_efs_access_point(
205206
os,
@@ -251,8 +252,8 @@ def test_efs_access_point(
251252
"Resource": f"arn:{get_arn_partition(region)}:elasticfilesystem:{region}:{account_id}:"
252253
f"file-system/{efs_filesystem_id}",
253254
"Condition": {
254-
"StringNotLike": {"elasticfilesystem:AccessPointArn":
255-
f"arn:{get_arn_partition(region)}:elasticfilesystem:{region}:{account_id}:access-point/{access_point_id}"
255+
"StringNotLike": {
256+
"elasticfilesystem:AccessPointArn": f"arn:{get_arn_partition(region)}:elasticfilesystem:{region}:{account_id}:access-point/{access_point_id}"
256257
}
257258
},
258259
},
@@ -266,14 +267,16 @@ def test_efs_access_point(
266267
"elasticfilesystem:ClientWrite",
267268
],
268269
"Resource": f"arn:{get_arn_partition(region)}:elasticfilesystem:{region}:{account_id}:"
269-
f"file-system/{efs_filesystem_id}"
270-
}
271-
]
270+
f"file-system/{efs_filesystem_id}",
271+
},
272+
],
272273
}
273274
boto3.client("efs").put_file_system_policy(FileSystemId=efs_filesystem_id, Policy=json.dumps(policy))
274275

275276
mount_dir = "efs_mount_dir"
276-
cluster_config = pcluster_config_reader(mount_dir=mount_dir, efs_filesystem_id=efs_filesystem_id, access_point_id=access_point_id)
277+
cluster_config = pcluster_config_reader(
278+
mount_dir=mount_dir, efs_filesystem_id=efs_filesystem_id, access_point_id=access_point_id
279+
)
277280
cluster = clusters_factory(cluster_config)
278281
remote_command_executor = RemoteCommandExecutor(cluster)
279282

@@ -283,7 +286,6 @@ def test_efs_access_point(
283286
_test_efs_correctly_shared(remote_command_executor, mount_dir, scheduler_commands)
284287

285288

286-
287289
def _check_efs_after_nodes_reboot(
288290
all_mount_dirs,
289291
cluster,

0 commit comments

Comments
 (0)