Merge "No disable reason defined for new services"

This commit is contained in:
Jenkins 2016-06-09 20:10:56 +00:00 committed by Gerrit Code Review
commit ab783d4537

View File

@ -532,7 +532,9 @@ def service_create(context, values):
service_ref = models.Service() service_ref = models.Service()
service_ref.update(values) service_ref.update(values)
if not CONF.enable_new_services: if not CONF.enable_new_services:
msg = _("New service disabled due to config option.")
service_ref.disabled = True service_ref.disabled = True
service_ref.disabled_reason = msg
try: try:
service_ref.save(context.session) service_ref.save(context.session)
except db_exc.DBDuplicateEntry as e: except db_exc.DBDuplicateEntry as e: