diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-14 20:13:46 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 23:18:16 +0000 |
| commit | 1dd8cca63102b1718609c5e2903e1ea468c4c469 (patch) | |
| tree | f777759b24a40426cbfbf6332f65f8f7d16b52ad /scripts/lib/wic/plugins/source/rootfs.py | |
| parent | 7c163ada95d2b304371f4d7a5dbef73ac37c1836 (diff) | |
| download | poky-1dd8cca63102b1718609c5e2903e1ea468c4c469.tar.gz | |
wic: use wic logger in wic source plugins
Replaced msger with wic logger in wic source plugins.
(From OE-Core rev: 19a868e9ad12fb27a7f713685d12f3d310fd6961)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index c57a4341d1..21b653925c 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py | |||
| @@ -25,15 +25,18 @@ | |||
| 25 | # Joao Henrique Ferreira de Freitas <joaohf (at] gmail.com> | 25 | # Joao Henrique Ferreira de Freitas <joaohf (at] gmail.com> |
| 26 | # | 26 | # |
| 27 | 27 | ||
| 28 | import logging | ||
| 28 | import os | 29 | import os |
| 29 | import shutil | 30 | import shutil |
| 31 | import sys | ||
| 30 | 32 | ||
| 31 | from oe.path import copyhardlinktree | 33 | from oe.path import copyhardlinktree |
| 32 | 34 | ||
| 33 | from wic import msger | ||
| 34 | from wic.pluginbase import SourcePlugin | 35 | from wic.pluginbase import SourcePlugin |
| 35 | from wic.utils.misc import get_bitbake_var, exec_cmd | 36 | from wic.utils.misc import get_bitbake_var, exec_cmd |
| 36 | 37 | ||
| 38 | logger = logging.getLogger('wic') | ||
| 39 | |||
| 37 | class RootfsPlugin(SourcePlugin): | 40 | class RootfsPlugin(SourcePlugin): |
| 38 | """ | 41 | """ |
| 39 | Populate partition content from a rootfs directory. | 42 | Populate partition content from a rootfs directory. |
| @@ -48,10 +51,10 @@ class RootfsPlugin(SourcePlugin): | |||
| 48 | 51 | ||
| 49 | image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) | 52 | image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) |
| 50 | if not os.path.isdir(image_rootfs_dir): | 53 | if not os.path.isdir(image_rootfs_dir): |
| 51 | msg = "No valid artifact IMAGE_ROOTFS from image named" | 54 | logger.error("No valid artifact IMAGE_ROOTFS from image named %s " |
| 52 | msg += " %s has been found at %s, exiting.\n" % \ | 55 | "has been found at %s, exiting.\n", |
| 53 | (rootfs_dir, image_rootfs_dir) | 56 | rootfs_dir, image_rootfs_dir) |
| 54 | msger.error(msg) | 57 | sys.exit(1) |
| 55 | 58 | ||
| 56 | return image_rootfs_dir | 59 | return image_rootfs_dir |
| 57 | 60 | ||
| @@ -66,8 +69,9 @@ class RootfsPlugin(SourcePlugin): | |||
| 66 | """ | 69 | """ |
| 67 | if part.rootfs_dir is None: | 70 | if part.rootfs_dir is None: |
| 68 | if not 'ROOTFS_DIR' in krootfs_dir: | 71 | if not 'ROOTFS_DIR' in krootfs_dir: |
| 69 | msg = "Couldn't find --rootfs-dir, exiting" | 72 | logger.error("Couldn't find --rootfs-dir, exiting") |
| 70 | msger.error(msg) | 73 | sys.exit(1) |
| 74 | |||
| 71 | rootfs_dir = krootfs_dir['ROOTFS_DIR'] | 75 | rootfs_dir = krootfs_dir['ROOTFS_DIR'] |
| 72 | else: | 76 | else: |
| 73 | if part.rootfs_dir in krootfs_dir: | 77 | if part.rootfs_dir in krootfs_dir: |
| @@ -75,9 +79,9 @@ class RootfsPlugin(SourcePlugin): | |||
| 75 | elif part.rootfs_dir: | 79 | elif part.rootfs_dir: |
| 76 | rootfs_dir = part.rootfs_dir | 80 | rootfs_dir = part.rootfs_dir |
| 77 | else: | 81 | else: |
| 78 | msg = "Couldn't find --rootfs-dir=%s connection" | 82 | logger.error("Couldn't find --rootfs-dir=%s connection or " |
| 79 | msg += " or it is not a valid path, exiting" | 83 | "it is not a valid path, exiting", part.rootfs_dir) |
| 80 | msger.error(msg % part.rootfs_dir) | 84 | sys.exit(1) |
| 81 | 85 | ||
| 82 | real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) | 86 | real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) |
| 83 | 87 | ||
