Add Sync template feature to kingbird.

"Sync template" feature is introduced in kingbird to
sync multiple resource_types to multiple regions
at a single request.
This feature is changed based on the
Commit ID : 69223a78f9.

Depends-On:  <I4aa422546a2949438328c8fe47e89f3079e2eb65>
Change-Id: I3ef8d8e707d586b25f286a61b723a1bd067191bc
This commit is contained in:
mounikasreeram 2018-01-25 17:20:11 +05:30
parent 69223a78f9
commit a4a49045fe
1 changed files with 8 additions and 2 deletions

View File

@ -114,8 +114,14 @@ class ResourceSyncController(object):
result = db_api.sync_job_create(context, parent_job_id)
except exceptions.InternalError:
pecan.abort(500, _('Internal Server Error.'))
response = self._get_post_data(request_data,
context, result)
if 'Sync' in request_data.keys():
for iteration in range(len(request_data['Sync'])):
payload = request_data['Sync'][iteration]
response = self._get_post_data(payload,
context, result)
else:
response = self._get_post_data(request_data,
context, result)
return response
def _get_post_data(self, payload, context, result):