diff --git a/coriolis/wsman.py b/coriolis/wsman.py index 428f269e5..75fa68632 100644 --- a/coriolis/wsman.py +++ b/coriolis/wsman.py @@ -111,6 +111,18 @@ def _exec_command(self, cmd, args=[], timeout=None): except requests.exceptions.ReadTimeout: raise exception.OSMorphingWinRMOperationTimeout( cmd=("%s %s" % (cmd, " ".join(args))), timeout=timeout) + except winrm_exceptions.InvalidCredentialsError as ex: + raise exception.NotAuthorized( + message="The WinRM connection credentials are invalid. " + "If you are using a template with a default " + "pre-baked username/password, please ensure " + "that you have passed the credentials to the " + "destination Coriolis plugin you have selected," + " either via the Target Environment parameters " + "set when creating the Migration/Replica, or " + "by setting it in the destination plugin's " + "dedicated section of the coriolis.conf " + "static configuration file.") from ex finally: self._protocol.cleanup_command(shell_id, command_id)