Skip to content

Commit 1f7a829

Browse files
author
Michael Schwarcz
committed
Compare non-secure image name without extension
- For cases where non-secure image is HEX and secure image is BIN
1 parent f155057 commit 1f7a829

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/psa/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
from os.path import basename
18+
from os.path import basename, splitext
1919
from tools.resources import FileType
2020

2121

@@ -29,7 +29,10 @@ def find_secure_image(notify, resources, ns_image_path, configured_s_image_filen
2929
assert image_files, 'No image files found for this target'
3030

3131
secure_image = next((f for f in image_files if basename(f) == configured_s_image_filename), None)
32-
secure_image = next((f for f in image_files if basename(f) == basename(ns_image_path)), secure_image)
32+
secure_image = next(
33+
(f for f in image_files if splitext(basename(f))[0] == splitext(basename(ns_image_path))[0]),
34+
secure_image
35+
)
3336

3437
if secure_image:
3538
notify.debug("Secure image file found: %s." % secure_image)

0 commit comments

Comments
 (0)