Skip to content

Commit 9106cfb

Browse files
author
SrikanteswaraRao Talluri
committed
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 aaa2f59.
1 parent 4c01d81 commit 9106cfb

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎tools/marvin/marvin/cloudstackConnection.py‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,26 @@
2121
import hmac
2222
import hashlib
2323
import time
24-
from cloudstackAPI import queryAsyncJobResult
24+
from cloudstackAPI import *
2525
import jsonHelper
2626
from marvin.codes import (
2727
FAILED,
28+
INVALID_RESPONSE,
29+
INVALID_INPUT,
2830
JOB_FAILED,
31+
JOB_INPROGRESS,
2932
JOB_CANCELLED,
30-
JOB_SUCCEEDED,
31-
JOB_NO_EXCEPTION,
32-
JOB_EXCEPTION_OCCURED
33+
JOB_SUCCEEDED
3334
)
34-
from marvin.cloudstackException import (GetDetailExceptionInfo,
35-
InvalidParameterException)
35+
from requests import (
36+
ConnectionError,
37+
HTTPError,
38+
Timeout,
39+
RequestException
40+
)
41+
from marvin.cloudstackException import (
42+
InvalidParameterException,
43+
GetDetailExceptionInfo)
3644

3745

3846
class CSConnection(object):
@@ -92,7 +100,6 @@ def __poll(self, jobid, response_cmd):
92100
start_time = time.time()
93101
end_time = time.time()
94102
async_response = FAILED
95-
jobresultcode = JOB_NO_EXCEPTION
96103
self.logger.debug("=== Jobid: %s Started ===" % (str(jobid)))
97104
while timeout > 0:
98105
async_response = self.\
@@ -102,7 +109,6 @@ def __poll(self, jobid, response_cmd):
102109
if job_status in [JOB_FAILED,
103110
JOB_CANCELLED,
104111
JOB_SUCCEEDED]:
105-
jobresultcode = async_response.jobresultcode
106112
break
107113
time.sleep(5)
108114
timeout -= 5
@@ -116,8 +122,6 @@ def __poll(self, jobid, response_cmd):
116122
"TotalTime:%s===" %
117123
(str(jobid), str(time.ctime(start_time)),
118124
str(time.ctime(end_time)), str(tot_time)))
119-
if jobresultcode == JOB_EXCEPTION_OCCURED:
120-
async_response = FAILED
121125
return async_response
122126
except Exception as e:
123127
self.__lastError = e

‎tools/marvin/marvin/codes.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
JOB_SUCCEEDED = 1
6161
JOB_FAILED = 2
6262
JOB_CANCELLED = 3
63-
JOB_EXCEPTION_OCCURED = 530
64-
JOB_NO_EXCEPTION = 0
6563
'''
6664
User Related Codes
6765
'''

0 commit comments

Comments
 (0)