oc-cdtapi 3.16.1__py3-none-any.whl → 3.17.1__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
@@ -153,6 +153,34 @@ class PgQAPI (object):
153
153
  self.exec_update('update queue_message set proc_start=now(), status=%s where id = %s', ('A', message_id) )
154
154
  return payload
155
155
 
156
+ def msg_proc_end(self, message_id):
157
+ logging.debug('reached msg_proc_end')
158
+ logging.debug('ending processing of message [%s]' % message_id)
159
+ ds = self.get_msg(message_id)
160
+ if not ds:
161
+ logging.error('message [%s] does not exist' % message_id)
162
+ return None
163
+ (msg_status, payload) = ds
164
+ if msg_status != 'A':
165
+ logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
166
+ return False
167
+ self.exec_update('update queue_message set proc_end=now(), status=%s where id = %s', ('P', message_id) )
168
+ return payload
169
+
170
+ def msg_proc_fail(self, message_id, error_message):
171
+ logging.debug('reached msg_proc_fail')
172
+ logging.debug('failing processing of message [%s]' % message_id)
173
+ ds = self.get_msg(message_id)
174
+ if not ds:
175
+ logging.error('message [%s] does not exist' % message_id)
176
+ return None
177
+ (msg_status, payload) = ds
178
+ if msg_status != 'A':
179
+ logging.error('message [%s] is in bad status [%s]' % (str(message_id), msg_status) )
180
+ 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) )
182
+ return payload
183
+
156
184
  def new_msg_from_queue(self, queue_code):
157
185
  logging.debug('reached new_msg_from_queue')
158
186
  logging.debug('checking queue [%s]' % queue_code)
@@ -166,7 +194,6 @@ class PgQAPI (object):
166
194
  return None
167
195
  msg_id = ds[0][0]
168
196
  logging.debug('found new message id [%s], [%s] new messages in queue' % (msg_id, ds[0][1]) )
169
- logging.debug('setting status of message to A')
170
197
  payload = self.msg_proc_start(msg_id)
171
- return payload
198
+ return payload, msg_id
172
199
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oc-cdtapi
3
- Version: 3.16.1
3
+ Version: 3.17.1
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=bAgwo4YVuD60uAEv7hrjTQmmAfcMP86IBlSNhlXJzWc,6882
9
+ oc_cdtapi/PgQAPI.py,sha256=rQxO6N_e1l_ACaAgE0MA1WLHlWypdw6igy942ly6uRo,8151
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.16.1.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
14
- oc_cdtapi-3.16.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
15
- oc_cdtapi-3.16.1.dist-info/METADATA,sha256=9ZNIwctxJRqKmpX-Tf-ls5uUCWBvMOYYZLrM8WIwvbA,484
16
- oc_cdtapi-3.16.1.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
17
- oc_cdtapi-3.16.1.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
18
- oc_cdtapi-3.16.1.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.2)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5