From 1a85874964ef399ee99a90a2b5a0c87a1b66afdd Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Mon, 25 Nov 2019 15:29:05 -0500 Subject: [PATCH] Raise specific exception if migration in progress --- awxkit/awxkit/api/pages/page.py | 2 ++ awxkit/awxkit/exceptions.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/awxkit/awxkit/api/pages/page.py b/awxkit/awxkit/api/pages/page.py index 8b6df80c75..653974cb71 100644 --- a/awxkit/awxkit/api/pages/page.py +++ b/awxkit/awxkit/api/pages/page.py @@ -184,6 +184,8 @@ class Page(object): a __class__ instance if the request path is different than the caller's `endpoint`. """ request_path = response.request.path_url + if request_path == '/migrations_notran/': + raise exc.IsMigrating('You have been redirected to the migration-in-progress page.') request_method = response.request.method.lower() self.last_elapsed = response.elapsed diff --git a/awxkit/awxkit/exceptions.py b/awxkit/awxkit/exceptions.py index e5315c0930..d8d132cef2 100644 --- a/awxkit/awxkit/exceptions.py +++ b/awxkit/awxkit/exceptions.py @@ -96,3 +96,8 @@ class WaitUntilTimeout(Common): class UnexpectedAWXState(Common): pass + + +class IsMigrating(Common): + + pass