Skip to content

Commit c28ee2a

Browse files
committed
migration 3
1 parent 47da73c commit c28ee2a

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/internaldafny/extern/InternalLegacyOverride.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,10 @@ def legacyActions(attribute_actions_on_encrypt):
137137
except Exception as e:
138138
return InternalLegacyOverride.CreateBuildFailure(InternalLegacyOverride.CreateError(str(e)))
139139

140-
@staticmethod
141140
def EncryptItem(self, input):
142141
"""Encrypt an item using the legacy DynamoDB encryptor.
143142
144-
This is a static method that is called with the instance as the first parameter,
145-
allowing access to instance attributes while maintaining the expected signature.
146-
147143
Args:
148-
self: The InternalLegacyOverride instance
149144
input: EncryptItemInput containing the plaintext item to encrypt
150145
151146
Returns:
@@ -173,20 +168,15 @@ def EncryptItem(self, input):
173168
return Wrappers.Result_Success(output)
174169

175170
except Exception as e:
176-
# Return an appropriate error result
171+
# Return an appropriate error result with the exception details
177172
return Wrappers.Result_Failure(
178-
InternalLegacyOverride.CreateError(str(e))
173+
InternalLegacyOverride.CreateError(f"Error during encryption: {str(e)}")
179174
)
180175

181-
@staticmethod
182176
def DecryptItem(self, input):
183177
"""Decrypt an item using the legacy DynamoDB encryptor.
184-
185-
This is a static method that is called with the instance as the first parameter,
186-
allowing access to instance attributes while maintaining the expected signature.
187-
178+
188179
Args:
189-
self: The InternalLegacyOverride instance
190180
input: DecryptItemInput containing the encrypted item to decrypt
191181
192182
Returns:
@@ -222,9 +212,9 @@ def DecryptItem(self, input):
222212
return Wrappers.Result_Success(output)
223213

224214
except Exception as e:
225-
# Return an appropriate error result
215+
# Return an appropriate error result with the exception details
226216
return Wrappers.Result_Failure(
227-
InternalLegacyOverride.CreateError(str(e))
217+
InternalLegacyOverride.CreateError(f"Error during decryption: {str(e)}")
228218
)
229219

230220
def __init__(self):

Examples/runtimes/python/Migration/test/ddbec_to_awsdbe/awsdbe/test_migration_step_3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
pytestmark = [pytest.mark.examples]
2121

22-
def tes_setup():
22+
def test_setup():
2323
common.setup_awsdbe_client_with_legacy_override(TEST_KMS_KEY_ID, TEST_DDB_TABLE_NAME)
2424

2525

0 commit comments

Comments
 (0)