def create_resources(self, job_id, force, region, source_keypair,
                      session, context):
     """Create resources using threads."""
     target_nova_client = NovaClient(region, session)
     try:
         target_nova_client.create_keypairs(force, source_keypair)
         LOG.info('keypair %(keypair)s created in %(region)s'
                  % {'keypair': source_keypair.name, 'region': region})
         try:
             db_api.resource_sync_update(context, job_id, region,
                                         source_keypair.name,
                                         consts.JOB_SUCCESS)
         except exceptions.JobNotFound():
             raise
     except Exception as exc:
         LOG.error('Exception Occurred: %(msg)s in %(region)s'
                   % {'msg': exc.message, 'region': region})
         try:
             db_api.resource_sync_update(context, job_id, region,
                                         source_keypair.name,
                                         consts.JOB_FAILURE)
         except exceptions.JobNotFound():
             raise
         pass