Skip to content

Commit 31f3a23

Browse files
committed
contact postal info is not mandatory anymore
1 parent 67372c3 commit 31f3a23

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

.circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ jobs:
1616
workflows:
1717
my-custom-workflow:
1818
jobs:
19-
- epp-python-client-job
19+
- epp-python-client-job:
20+
filters:
21+
branches:
22+
ignore: master

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup_params = dict(
44
name='epp-python-client',
5-
version='0.0.17',
5+
version='0.0.18',
66
author='Veselin Penev',
77
author_email='[email protected]',
88
packages=find_packages(where='src'),

src/epp/rpc_client.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def request(self, query, request_time_limit=0):
142142
try:
143143
self.rabbitmq_connection.process_data_events(time_limit=request_time_limit)
144144
except Exception as e:
145-
logger.exception('Error from RabbitMQ.process_data_events')
145+
logger.exception('Error from RabbitMQ.process_data_events: %r', e)
146146
self.reply = '{"error": "EPP request processing failed: %s"}' % e
147147
if not self.reply and request_time_limit:
148148
self.reply = '{"error": "EPP request timeout"}'
@@ -233,7 +233,7 @@ def do_rpc_request(json_request, cache_client=True, health_marker_filepath=None,
233233
logger.error('empty response from EPP_RPC_Client')
234234
raise ValueError('empty response from EPP_RPC_Client')
235235
except Exception as exc:
236-
logger.exception('ERROR from EPP_RPC_Client: %r' % exc)
236+
logger.exception('ERROR from EPP_RPC_Client: %r', exc)
237237
health_marker_filepath = os.environ.get('RPC_CLIENT_HEALTH_FILE', health_marker_filepath)
238238
if not health_marker_filepath:
239239
# if there is no configuration for the health marker file - do not do any retries and just fail
@@ -244,15 +244,19 @@ def do_rpc_request(json_request, cache_client=True, health_marker_filepath=None,
244244
time.sleep(2)
245245
# if the issue is still here it will raise EPPBadResponse() in run() method anyway
246246
_CachedClient = None
247-
client = make_client(
248-
cache_client=cache_client,
249-
rabbitmq_credentials=rabbitmq_credentials,
250-
rabbitmq_connection_timeout=rabbitmq_connection_timeout,
251-
rabbitmq_queue_name=rabbitmq_queue_name,
252-
json_conf=json_conf,
253-
)
254-
client.connect()
255-
reply = client.request(json.dumps(json_request), request_time_limit=request_time_limit)
247+
try:
248+
client = make_client(
249+
cache_client=cache_client,
250+
rabbitmq_credentials=rabbitmq_credentials,
251+
rabbitmq_connection_timeout=rabbitmq_connection_timeout,
252+
rabbitmq_queue_name=rabbitmq_queue_name,
253+
json_conf=json_conf,
254+
)
255+
client.connect()
256+
reply = client.request(json.dumps(json_request), request_time_limit=request_time_limit)
257+
except Exception as exc:
258+
logger.exception('ERROR from EPP_RPC_Client after retry: %r', exc)
259+
return None
256260
return reply
257261

258262
#------------------------------------------------------------------------------
@@ -433,8 +437,6 @@ def cmd_contact_create(contact_id, email=None, voice=None, fax=None, auth_info=N
433437
cmd['args']['email'] = email
434438
if auth_info is not None:
435439
cmd['args']['auth_info'] = auth_info
436-
if not include_international and not include_local:
437-
include_international = True
438440
if include_international:
439441
for cont in contacts_list[:]:
440442
international = copy.deepcopy(cont)
@@ -502,8 +504,6 @@ def cmd_contact_update(contact_id, email=None, voice=None, fax=None, auth_info=N
502504
cmd['args']['email'] = email
503505
if auth_info is not None:
504506
cmd['args']['auth_info'] = auth_info
505-
if not include_international and not include_local:
506-
include_international = True
507507
if include_international:
508508
for cont in contacts_list[:]:
509509
international = copy.deepcopy(cont)

0 commit comments

Comments
 (0)