if post scripts fails, CreatorError is raised to catch script errors such as signing...
authorDohyung Kim <dohyung2.kim@samsung.com>
Tue, 21 Nov 2017 06:45:37 +0000 (15:45 +0900)
committeryuhuan.yang <yuhuan.yang@samsung.com>
Tue, 30 Jan 2018 02:40:16 +0000 (10:40 +0800)
commit925cece6ba20bcf90724b53815953725b6cae2a2
tree44fa539914c058d602ec31c5741ef2dde7380120
parentb6dcc8b96ee150bc7afce70aa619a01c59c029fd
if post scripts fails, CreatorError is raised to catch script errors such as signing error

  $ cat PLATFORM.ks
  ...
  %post
  # if you want to catch script error, add set command and trap command at the top of script
  set -e
  trap 'echo KS POST ERROR: command \"$BASH_COMMAND\" failed with error code $?' ERR
  # it will cause an error
  /usr/bin/error_command
  %end
  ...

  $ sudo mic cr auto PLATFORM.ks
  ...
  INFO: Running post scripts ...
  INFO: /tmp/ks-postscript-FShzJp: line 5: /usr/bin/error_command: No such file or directory
  INFO: KS POST ERROR: command "/usr/bin/error_command" failed with error code 1
  INFO:
  ERROR: Failed to execute %post script with '/bin/sh'

Change-Id: I1a34a343b8bdd044ca85939e446c43cce783c900
Signed-off-by: Dohyung Kim <dohyung2.kim@samsung.com>
mic/imager/baseimager.py