diff --git a/core/dbt/config/runtime.py b/core/dbt/config/runtime.py index 820b966eea8..40f12a1098e 100644 --- a/core/dbt/config/runtime.py +++ b/core/dbt/config/runtime.py @@ -545,8 +545,12 @@ def _get_rendered_profile( args, profile_renderer, profile_name ) except (DbtProjectError, DbtProfileError) as exc: + selected_profile_name = Profile.pick_profile_name( + args_profile_name=getattr(args, 'profile', None), + project_profile_name=profile_name + ) fire_event(ProfileLoadError(exc=exc)) - fire_event(ProfileNotFound(profile_name=profile_name)) + fire_event(ProfileNotFound(profile_name=selected_profile_name)) # return the poisoned form profile = UnsetProfile() # disable anonymous usage statistics diff --git a/core/dbt/task/clean.py b/core/dbt/task/clean.py index 6dfc8b3328b..3bee3459437 100644 --- a/core/dbt/task/clean.py +++ b/core/dbt/task/clean.py @@ -38,7 +38,7 @@ def run(self): """ move_to_nearest_project_dir(self.args) if ('dbt_modules' in self.config.clean_targets and - self.config.packages_install_path != 'dbt_modules'): + self.config.packages_install_path not in self.config.clean_targets): deprecations.warn('install-packages-path') for path in self.config.clean_targets: fire_event(CheckCleanPath(path=path))