diff options
Diffstat (limited to 'scripts/devtool')
-rwxr-xr-x | scripts/devtool | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/devtool b/scripts/devtool index 596fdaac66..d29faf0238 100755 --- a/scripts/devtool +++ b/scripts/devtool | |||
@@ -45,7 +45,7 @@ class ConfigHandler: | |||
45 | try: | 45 | try: |
46 | ret = self.config_obj.get(section, option) | 46 | ret = self.config_obj.get(section, option) |
47 | except (configparser.NoOptionError, configparser.NoSectionError): | 47 | except (configparser.NoOptionError, configparser.NoSectionError): |
48 | if default != None: | 48 | if default is not None: |
49 | ret = default | 49 | ret = default |
50 | else: | 50 | else: |
51 | raise | 51 | raise |
@@ -147,7 +147,7 @@ def create_workspace(args, config, basepath, workspace): | |||
147 | _enable_workspace_layer(workspacedir, config, basepath) | 147 | _enable_workspace_layer(workspacedir, config, basepath) |
148 | 148 | ||
149 | def _create_workspace(workspacedir, config, basepath, layerseries=None): | 149 | def _create_workspace(workspacedir, config, basepath, layerseries=None): |
150 | import bb | 150 | import bb.utils |
151 | 151 | ||
152 | confdir = os.path.join(workspacedir, 'conf') | 152 | confdir = os.path.join(workspacedir, 'conf') |
153 | if os.path.exists(os.path.join(confdir, 'layer.conf')): | 153 | if os.path.exists(os.path.join(confdir, 'layer.conf')): |
@@ -192,7 +192,7 @@ def _create_workspace(workspacedir, config, basepath, layerseries=None): | |||
192 | 192 | ||
193 | def _enable_workspace_layer(workspacedir, config, basepath): | 193 | def _enable_workspace_layer(workspacedir, config, basepath): |
194 | """Ensure the workspace layer is in bblayers.conf""" | 194 | """Ensure the workspace layer is in bblayers.conf""" |
195 | import bb | 195 | import bb.utils |
196 | bblayers_conf = os.path.join(basepath, 'conf', 'bblayers.conf') | 196 | bblayers_conf = os.path.join(basepath, 'conf', 'bblayers.conf') |
197 | if not os.path.exists(bblayers_conf): | 197 | if not os.path.exists(bblayers_conf): |
198 | logger.error('Unable to find bblayers.conf') | 198 | logger.error('Unable to find bblayers.conf') |
@@ -286,6 +286,7 @@ def main(): | |||
286 | scriptutils.logger_setup_color(logger, global_args.color) | 286 | scriptutils.logger_setup_color(logger, global_args.color) |
287 | 287 | ||
288 | if global_args.bbpath is None: | 288 | if global_args.bbpath is None: |
289 | import bb | ||
289 | try: | 290 | try: |
290 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) | 291 | tinfoil = setup_tinfoil(config_only=True, basepath=basepath) |
291 | try: | 292 | try: |
@@ -341,6 +342,7 @@ def main(): | |||
341 | ret = err.exitcode | 342 | ret = err.exitcode |
342 | except argparse_oe.ArgumentUsageError as ae: | 343 | except argparse_oe.ArgumentUsageError as ae: |
343 | parser.error_subcommand(ae.message, ae.subcommand) | 344 | parser.error_subcommand(ae.message, ae.subcommand) |
345 | ret = 2 | ||
344 | 346 | ||
345 | return ret | 347 | return ret |
346 | 348 | ||