logger.warning('Ocloud {} does not exists.'.format(data.id))
return
logger.debug('O-Cloud Global UUID: {}'.format(ocloud.globalCloudId))
- # ocloud_dict = ocloud.serialize()
- ocloud_dict = {
- 'oCloudId': ocloud.oCloudId,
- 'globalcloudId': ocloud.globalCloudId,
- 'globalCloudId': ocloud.globalCloudId,
- 'name': ocloud.name,
- 'description': ocloud.description,
- 'serviceUri': ocloud.serviceUri
- }
+ ocloud_dict = ocloud.get_notification_dict()
if data.notificationEventType == NotificationEventEnum.CREATE:
register_smo(notifications, ocloud_dict)
elif data.notificationEventType in [NotificationEventEnum.MODIFY,
'smo_token_algo': 'RS256'
}
- callback_data = json.dumps({
+ callback = {
'globalCloudId': reg_data['globalCloudId'],
'oCloudId': reg_data['oCloudId'],
'IMS_EP': config.get_api_url(),
'smo_token_data': smo_token_info
- })
+ }
logger.info('callback URL: {}'.format(conf.DEFAULT.smo_register_url))
- logger.debug('callback data: {}'.format(callback_data))
- return notifications.send(conf.DEFAULT.smo_register_url, callback_data)
+ logger.debug('callback data: {}'.format(json.dumps(callback)))
+ return notifications.send(conf.DEFAULT.smo_register_url, callback)