oc-cdtapi 3.17.1__py3-none-any.whl → 3.18.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
oc_cdtapi/PgQAPI.py CHANGED
@@ -102,7 +102,7 @@ class PgQAPI (object):
102
102
  def get_msg(self, message_id):
103
103
  logging.debug('reached get_msg')
104
104
  logging.debug('getting status of message [%s]' % message_id)
105
- ds = self.exec_select('select status, payload from queue_message where id = %s', (str(message_id) ) )
105
+ ds = self.exec_select('select status, payload from queue_message where id = %s', (str(message_id), ) )
106
106
  if ds:
107
107
  logging.debug('message found, returning [%s]', ds[0])
108
108
  return ds[0]
@@ -140,6 +140,7 @@ class PgQAPI (object):
140
140
  return None
141
141
 
142
142
  def msg_proc_start(self, message_id):
143
+ # TODO add consumer ip
143
144
  logging.debug('reached msg_proc_start')
144
145
  logging.debug('starting processing of message [%s]' % message_id)
145
146
  ds = self.get_msg(message_id)
@@ -151,9 +152,10 @@ class PgQAPI (object):
151
152
  logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
152
153
  return False
153
154
  self.exec_update('update queue_message set proc_start=now(), status=%s where id = %s', ('A', message_id) )
155
+ logging.debug('returning payload [%s]' % payload)
154
156
  return payload
155
157
 
156
- def msg_proc_end(self, message_id):
158
+ def msg_proc_end(self, message_id, error_message=None, comment_text=None):
157
159
  logging.debug('reached msg_proc_end')
158
160
  logging.debug('ending processing of message [%s]' % message_id)
159
161
  ds = self.get_msg(message_id)
@@ -164,10 +166,10 @@ class PgQAPI (object):
164
166
  if msg_status != 'A':
165
167
  logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
166
168
  return False
167
- self.exec_update('update queue_message set proc_end=now(), status=%s where id = %s', ('P', message_id) )
169
+ self.exec_update('update queue_message set proc_end=now(), status=%s, error_message=%s, comment_text=%s where id = %s', ('P', error_message, comment_text, message_id) )
168
170
  return payload
169
171
 
170
- def msg_proc_fail(self, message_id, error_message):
172
+ def msg_proc_fail(self, message_id, error_message=None, comment_text=None):
171
173
  logging.debug('reached msg_proc_fail')
172
174
  logging.debug('failing processing of message [%s]' % message_id)
173
175
  ds = self.get_msg(message_id)
@@ -178,7 +180,21 @@ class PgQAPI (object):
178
180
  if msg_status != 'A':
179
181
  logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
180
182
  return False
181
- self.exec_update('update queue_message set proc_end=now(), status=%s, error_message=%s where id = %s', ('F', message_id, error_message) )
183
+ self.exec_update('update queue_message set proc_end=now(), status=%s, error_message=%s, comment_text=%s where id = %s', ('F', error_message, comment_text, message_id) )
184
+ return payload
185
+
186
+ def msg_proc_end(self, message_id):
187
+ logging.debug('reached msg_proc_end')
188
+ logging.debug('ending processing of message [%s]' % message_id)
189
+ ds = self.get_msg(message_id)
190
+ if not ds:
191
+ logging.error('message [%s] does not exist' % message_id)
192
+ return None
193
+ (msg_status, payload) = ds
194
+ if msg_status != 'A':
195
+ logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
196
+ return False
197
+ self.exec_update('update queue_message set proc_end=now(), status=%s where id = %s', ('P', message_id) )
182
198
  return payload
183
199
 
184
200
  def new_msg_from_queue(self, queue_code):
@@ -194,6 +210,9 @@ class PgQAPI (object):
194
210
  return None
195
211
  msg_id = ds[0][0]
196
212
  logging.debug('found new message id [%s], [%s] new messages in queue' % (msg_id, ds[0][1]) )
213
+ logging.debug('requesting payload from msg_proc_start')
197
214
  payload = self.msg_proc_start(msg_id)
198
- return payload, msg_id
215
+ logging.debug('msg_proc_start returned [%s]' % payload)
216
+ logging.debug('returning payload [%s] with msg_id [%s]' % (payload, msg_id) )
217
+ return payload,msg_id
199
218
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oc-cdtapi
3
- Version: 3.17.1
3
+ Version: 3.18.2
4
4
  Summary: Custom Development python API libraries
5
5
  License: Apache2.0
6
6
  Requires-Python: >=3.6
@@ -6,13 +6,13 @@ oc_cdtapi/DmsGetverAPI.py,sha256=ZPU4HlF59fngKu5mSFhtss3rlBuduffDOSm_y3XWrxk,155
6
6
  oc_cdtapi/ForemanAPI.py,sha256=9r1MSOsubiSxM1sdzF2MHD7IcSwX9Y4UDJknHqQK07g,44255
7
7
  oc_cdtapi/JenkinsAPI.py,sha256=lZ8pe3a4eb_6h53JE7QLuzOSlu7Sqatc9PQwWhio9Vg,15748
8
8
  oc_cdtapi/NexusAPI.py,sha256=uU12GtHvKlWorFaPAnFcQ5AGEc94MZ5SdmfM2Pw3F7A,26122
9
- oc_cdtapi/PgQAPI.py,sha256=rQxO6N_e1l_ACaAgE0MA1WLHlWypdw6igy942ly6uRo,8151
9
+ oc_cdtapi/PgQAPI.py,sha256=OUdUwaoa8-Yo08vF6qo94Ml42nRT8RtzbonRPRltWSE,9245
10
10
  oc_cdtapi/RundeckAPI.py,sha256=O3LmcFaHSz8UqeUyIHTTEMJncDD191Utd-iZaeJay2s,24243
11
11
  oc_cdtapi/TestServer.py,sha256=HV97UWg2IK4gOYAp9yaMdwFUWsw9v66MxyZdI3qQctA,2715
12
12
  oc_cdtapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- oc_cdtapi-3.17.1.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
14
- oc_cdtapi-3.17.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- oc_cdtapi-3.17.1.dist-info/METADATA,sha256=_ro_PynB_h1s9PQiutS6kmaKQU5UY5OA3uWSsJnLa-c,484
16
- oc_cdtapi-3.17.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
17
- oc_cdtapi-3.17.1.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
18
- oc_cdtapi-3.17.1.dist-info/RECORD,,
13
+ oc_cdtapi-3.18.2.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
14
+ oc_cdtapi-3.18.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
+ oc_cdtapi-3.18.2.dist-info/METADATA,sha256=EkK4ZyYgF-GWWFx-59YTRgFiinOB_CDC318XSd288aw,484
16
+ oc_cdtapi-3.18.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ oc_cdtapi-3.18.2.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
18
+ oc_cdtapi-3.18.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5