From e8b8f7d18bc558c94367fc787c35f3242b0f1f8a Mon Sep 17 00:00:00 2001 From: annatisch Date: Mon, 28 Mar 2016 08:51:15 -0700 Subject: [PATCH 1/2] LRO polling fix for status enums --- .../Python/msrestazure/msrestazure/azure_operation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py b/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py index 085082b6ce..50a8c4e30f 100644 --- a/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py +++ b/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py @@ -41,14 +41,20 @@ def finished(status): + if hasattr(status, 'value'): + return status.value.lower() in FINISHED return str(status).lower() in FINISHED def failed(status): + if hasattr(status, 'value'): + return status.value.lower() in FAILED return str(status).lower() in FAILED def succeeded(status): + if hasattr(status, 'value'): + return status.value.lower() in SUCCEEDED return str(status).lower() in SUCCEEDED From 32a8ff13bb2222d33067b188e8233731529515ce Mon Sep 17 00:00:00 2001 From: annatisch Date: Mon, 28 Mar 2016 09:00:50 -0700 Subject: [PATCH 2/2] Edited changes --- .../Python/msrestazure/msrestazure/azure_operation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py b/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py index 50a8c4e30f..0386b3a30b 100644 --- a/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py +++ b/ClientRuntimes/Python/msrestazure/msrestazure/azure_operation.py @@ -42,19 +42,19 @@ def finished(status): if hasattr(status, 'value'): - return status.value.lower() in FINISHED + status = status.value return str(status).lower() in FINISHED def failed(status): if hasattr(status, 'value'): - return status.value.lower() in FAILED + status = status.value return str(status).lower() in FAILED def succeeded(status): if hasattr(status, 'value'): - return status.value.lower() in SUCCEEDED + status = status.value return str(status).lower() in SUCCEEDED