Repository: cloudstack Updated Branches: refs/heads/4.4-forward 4c01d81d8 -> 9106cfb4b
Revert "CLOUDSTACK-5674: Fixed cloudstackConnection.py to return FAILED in case of well handled exceptions returning from server having jobresultcode as 530" This reverts commit aaa2f5932ba8f7d3ef08ad5176744811589176f5. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9106cfb4 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9106cfb4 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9106cfb4 Branch: refs/heads/4.4-forward Commit: 9106cfb4be7d157cc4574e4dcfeb61d3792cc673 Parents: 4c01d81 Author: SrikanteswaraRao Talluri <tall...@apache.org> Authored: Wed May 14 18:45:01 2014 +0530 Committer: SrikanteswaraRao Talluri <tall...@apache.org> Committed: Wed May 14 18:45:01 2014 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/cloudstackConnection.py | 24 ++++++++++++++---------- tools/marvin/marvin/codes.py | 2 -- 2 files changed, 14 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9106cfb4/tools/marvin/marvin/cloudstackConnection.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 1ff8381..8044da7 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -21,18 +21,26 @@ import base64 import hmac import hashlib import time -from cloudstackAPI import queryAsyncJobResult +from cloudstackAPI import * import jsonHelper from marvin.codes import ( FAILED, + INVALID_RESPONSE, + INVALID_INPUT, JOB_FAILED, + JOB_INPROGRESS, JOB_CANCELLED, - JOB_SUCCEEDED, - JOB_NO_EXCEPTION, - JOB_EXCEPTION_OCCURED + JOB_SUCCEEDED ) -from marvin.cloudstackException import (GetDetailExceptionInfo, - InvalidParameterException) +from requests import ( + ConnectionError, + HTTPError, + Timeout, + RequestException +) +from marvin.cloudstackException import ( + InvalidParameterException, + GetDetailExceptionInfo) class CSConnection(object): @@ -92,7 +100,6 @@ class CSConnection(object): start_time = time.time() end_time = time.time() async_response = FAILED - jobresultcode = JOB_NO_EXCEPTION self.logger.debug("=== Jobid: %s Started ===" % (str(jobid))) while timeout > 0: async_response = self.\ @@ -102,7 +109,6 @@ class CSConnection(object): if job_status in [JOB_FAILED, JOB_CANCELLED, JOB_SUCCEEDED]: - jobresultcode = async_response.jobresultcode break time.sleep(5) timeout -= 5 @@ -116,8 +122,6 @@ class CSConnection(object): "TotalTime:%s===" % (str(jobid), str(time.ctime(start_time)), str(time.ctime(end_time)), str(tot_time))) - if jobresultcode == JOB_EXCEPTION_OCCURED: - async_response = FAILED return async_response except Exception as e: self.__lastError = e http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9106cfb4/tools/marvin/marvin/codes.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index 0619374..ef49c0c 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -60,8 +60,6 @@ JOB_INPROGRESS = 0 JOB_SUCCEEDED = 1 JOB_FAILED = 2 JOB_CANCELLED = 3 -JOB_EXCEPTION_OCCURED = 530 -JOB_NO_EXCEPTION = 0 ''' User Related Codes '''