예제 #1
0
def report_problem(fqdn):
    system = _get_system_by_FQDN(fqdn)
    data = read_json_request(request)
    message = (data.get('message') or u'').strip()
    requester = identity.current.user
    mail.system_problem_report(system, message, reporter=requester)
    system.record_activity(user=requester, service=u'HTTP',
            action=u'Reported problem', field=u'Status', new=message)
    # if we tracked problem reports we could return the details here
    return 'Reported', 201
예제 #2
0
def report_problem(fqdn):
    system = _get_system_by_FQDN(fqdn)
    data = read_json_request(request)
    message = (data.get('message') or u'').strip()
    requester = identity.current.user
    mail.system_problem_report(system, message, reporter=requester)
    system.record_activity(user=requester,
                           service=u'HTTP',
                           action=u'Reported problem',
                           field=u'Status',
                           new=message)
    # if we tracked problem reports we could return the details here
    return 'Reported', 201
예제 #3
0
 def report_system_problem(self, system, description, recipe_id=None, tg_errors=None, **kw):
     if tg_errors:
         raise HTTPError(status=400, message=tg_errors)
     # CheckRecipeValid has converted the id into an ORM object
     if recipe_id is not None:
         recipe = recipe_id
     else:
         recipe = None
     mail.system_problem_report(system, description,
         recipe, identity.current.user)
     activity = SystemActivity(identity.current.user, u'WEBUI', u'Reported problem',
             u'Status', None, description)
     system.activity.append(activity)
     return {}
예제 #4
0
 def report_system_problem(self, system, description, recipe_id=None, tg_errors=None, **kw):
     if tg_errors:
         raise HTTPError(status=400, message=tg_errors)
     # CheckRecipeValid has converted the id into an ORM object
     if recipe_id is not None:
         recipe = recipe_id
     else:
         recipe = None
     mail.system_problem_report(system, description,
         recipe, identity.current.user)
     system.record_activity(user=identity.current.user, service=u'WEBUI',
             action=u'Reported problem', field=u'Status',
             old=None, new=description)
     return {}
예제 #5
0
 def report_system_problem(self,
                           system,
                           description,
                           recipe_id=None,
                           tg_errors=None,
                           **kw):
     if tg_errors:
         raise HTTPError(status=400, message=tg_errors)
     # CheckRecipeValid has converted the id into an ORM object
     if recipe_id is not None:
         recipe = recipe_id
     else:
         recipe = None
     mail.system_problem_report(system, description, recipe,
                                identity.current.user)
     system.record_activity(user=identity.current.user,
                            service=u'WEBUI',
                            action=u'Reported problem',
                            field=u'Status',
                            old=None,
                            new=description)
     return {}