From 249f287af97d0238293a496486b136be652e57fe Mon Sep 17 00:00:00 2001 From: Memo Garcia Date: Mon, 6 Jul 2015 11:17:50 +0100 Subject: [PATCH] Job creation for multiple clients Implements: blueprint freezer-api-web-ui Change-Id: I6d2b29b18909cef627646b437454d6075b725df5 --- freezer_api/storage/elastic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freezer_api/storage/elastic.py b/freezer_api/storage/elastic.py index 055b257a..574285b1 100644 --- a/freezer_api/storage/elastic.py +++ b/freezer_api/storage/elastic.py @@ -21,6 +21,7 @@ Hudson (tjh@cryptsoft.com). import elasticsearch import logging +import uuid from freezer_api.common.utils import BackupMetadataDoc from freezer_api.common.utils import JobDoc from freezer_api.common.utils import ActionDoc @@ -314,7 +315,8 @@ class ElasticSearchEngine(object): message=('Client already registered with ' 'ID {0}'.format(client_id))) client_doc = {'client': doc, - 'user_id': user_id} + 'user_id': user_id, + 'uuid': uuid.uuid4().hex} self.client_manager.insert(client_doc) logging.info('Client registered, client_id: {0}'. format(client_id))