From 7ac28f960265e23395228721994522e80b83cd59 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Fri, 1 Jun 2018 20:19:12 +0200 Subject: [PATCH] pmb/flasher: Fix regression with exporting odin images (#1529) This makes the flasher work when no flash_method attribute exists on the args variable, which happens when it is invoked through the pmbootstrap export --odin command. This is a regression introduced in b29cc877a748 This fixes #1527 --- pmb/flasher/init.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pmb/flasher/init.py b/pmb/flasher/init.py index f9f6b548..511cc2e5 100644 --- a/pmb/flasher/init.py +++ b/pmb/flasher/init.py @@ -23,7 +23,11 @@ import pmb.helpers.mount def init(args): # Validate method - method = args.flash_method or args.deviceinfo["flash_method"] + if hasattr(args, 'flash_method'): + method = args.flash_method or args.deviceinfo["flash_method"] + else: + method = args.deviceinfo["flash_method"] + if method not in pmb.config.flashers: raise RuntimeError("Flash method " + method + " is not supported by the" " current configuration. However, adding a new flash method is "