Skip to content

Commit 3b4502d

Browse files
authored
Update schema diff to match schema format for customer set values (#74)
Co-authored-by: Michael Pultorak <pultormi@amazon.com>
1 parent 934b193 commit 3b4502d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/rpdk/guard_rail/core/stateful.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def _cast_path(value: str):
165165
"""cast the path of the change to process constructs"""
166166
pattern = r"(?<=\[)'?([\s\S]+?)'?(?=\])"
167167
value = value.replace("items']['properties", "*")
168+
value = value.replace("]['properties'][", "][")
168169
value = re.sub(r"[0-9]+]", "", value)
169170
return re.findall(pattern, value)
170171

tests/unit/core/test_stateful.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
{
256256
"relationshipRef": {
257257
"removed": [
258-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/KmsKeyId"
258+
"/properties/Configuration/ExecuteCommandConfiguration/KmsKeyId"
259259
]
260260
},
261261
"type": {
@@ -271,7 +271,7 @@
271271
{
272272
"relationshipRef": {
273273
"added": [
274-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/KmsKeyId"
274+
"/properties/Configuration/ExecuteCommandConfiguration/KmsKeyId"
275275
]
276276
},
277277
"type": {
@@ -541,13 +541,13 @@
541541
"properties": {
542542
"added": [
543543
"/properties/ECSEndpoint",
544-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/Logging",
544+
"/properties/Configuration/ExecuteCommandConfiguration/Logging",
545545
]
546546
},
547547
"relationshipRef": {
548548
"added": [
549549
"/properties/DefaultCapacityProviderStrategy/*/CapacityProvider",
550-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/KmsKeyId",
550+
"/properties/Configuration/ExecuteCommandConfiguration/KmsKeyId",
551551
]
552552
},
553553
"insertionOrder": {"removed": ["/properties/ClusterSettings"]},
@@ -556,13 +556,13 @@
556556
"properties": {
557557
"removed": [
558558
"/properties/ECSEndpoint",
559-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/Logging",
559+
"/properties/Configuration/ExecuteCommandConfiguration/Logging",
560560
]
561561
},
562562
"relationshipRef": {
563563
"removed": [
564564
"/properties/DefaultCapacityProviderStrategy/*/CapacityProvider",
565-
"/properties/Configuration/properties/ExecuteCommandConfiguration/properties/KmsKeyId",
565+
"/properties/Configuration/ExecuteCommandConfiguration/KmsKeyId",
566566
]
567567
},
568568
"insertionOrder": {"added": ["/properties/ClusterSettings"]},

0 commit comments

Comments
 (0)