def delete_service_profile(self, context, service_profile_id):
     with context.session.begin(subtransactions=True):
         profile_db = self._get_service_profile(context,
                                                service_profile_id)
         if profile_db.nodes:
             raise schain.ServiceProfileInUse(
                 profile_id=service_profile_id)
         context.session.delete(profile_db)
Example #2
0
 def delete_service_profile(self, context, service_profile_id):
     with db_api.context_manager.writer.using(context):
         profile_db = self._get_service_profile(context,
                                                service_profile_id)
         if profile_db.nodes:
             raise schain.ServiceProfileInUse(
                 profile_id=service_profile_id)
         context.session.delete(profile_db)
Example #3
0
 def delete_service_profile(self, context, service_profile_id):
     with db_api.CONTEXT_WRITER.using(context):
         profile_db = self._get_service_profile(context, service_profile_id)
         if profile_db.nodes:
             raise schain.ServiceProfileInUse(profile_id=service_profile_id)
         context.session.delete(profile_db)