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 b29cc877a7
This fixes #1527
This commit is contained in:
parent
08951548f6
commit
7ac28f9602
|
@ -23,7 +23,11 @@ import pmb.helpers.mount
|
|||
|
||||
def init(args):
|
||||
# Validate 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 "
|
||||
|
|
Loading…
Reference in New Issue