Ejemplo n.º 1
0
    def __init__(self, rowId=None, problem_id=None, title=None, created=None, closed=None, reported_by=None, description=None,
                       release=None, pronto_state=None, environment=None, fault_analysis_state=None, correction_plan_state=None,
                       correction_response_state=None, correction_workaround_state=None, user=None, severity=None,
                       corrections=None, attachments=None):
        self.id          = rowId
        self.problem_id  = problem_id
        self.title       = title
        self.created     = dateTime2IsoString(created)
        self.closed      = dateTime2IsoString(closed)
        self.reported_by = reported_by
        self.description = description

        self.release                     = release
        self.pronto_state                = pronto_state
        self.environment                 = environment
        self.fault_analysis_state        = fault_analysis_state
        self.correction_plan_state       = correction_plan_state
        self.correction_response_state   = correction_response_state
        self.correction_workaround_state = correction_workaround_state
        self.user                        = user
        self.severity                    = severity

        if corrections is None:
          self.corrections = []
        else:
          self.corrections = corrections;

        if attachments is None:
          self.attachments = []
        else:
          self.attachments = attachments;
Ejemplo n.º 2
0
 def __init__(self, rowId=None, start=None, end=None, eventType=None, content=None):
     self.id        = rowId
     self.start     = dateTime2IsoString(start)
     self.end       = dateTime2IsoString(end)
     self.eventType = eventType
     self.className = self.event_type_to_class_name(eventType)
     self.content   = content
Ejemplo n.º 3
0
    def _build_detailed_problem_report(self, row_data):
        problem_report = ProblemReportFull()

        # Problem Report
        problem_report.id           = row_data['pr_id']
        problem_report.problem_id   = row_data['pr_problem_id']
        problem_report.title        = row_data['pr_title']
        problem_report.created      = dateTime2IsoString(row_data['pr_created'])
        problem_report.created_days = datetime_timedelta_in_days(row_data['pr_created'], datetime.datetime.now())
        problem_report.closed       = dateTime2IsoString(row_data['pr_closed'])
        problem_report.reported_by  = row_data['pr_reported_by']
        problem_report.description  = row_data['pr_description']

        # Release
        problem_report.release = Release( row_data['rel_id'],
                                          row_data['rel_release'] )

        # Pronto State
        problem_report.pronto_state = ProntoState( row_data['ps_id'],
                                                   row_data['ps_state'] )

        # Environment
        problem_report.environment = Environment( row_data['env_id'],
                                                  row_data['env_name'],
                                                  row_data['env_environment'] )

        # Fault Analysis State
        problem_report.fault_analysis_state = FaultAnalysisState( row_data['fas_id'],
                                                                  row_data['fas_state'] )

        # Correction Plan, Response and Workaround States
        problem_report.correction_plan_state = CorrectionState( row_data['cps_id'],
                                                                row_data['cps_state'] )

        problem_report.correction_response_state = CorrectionState( row_data['crs_id'],
                                                                    row_data['crs_state'] )

        problem_report.correction_workaround_state = CorrectionState( row_data['cws_id'],
                                                                      row_data['cws_state'] )

        # User
        problem_report.user = User( row_data['user_id'],
                                    row_data['user_username'],
                                    row_data['user_email'],
                                    row_data['user_fullname'],
                                    row_data['user_displayname'])

        # Severity
        problem_report.severity = Severity( row_data['sev_id'],
                                            row_data['sev_type'],
                                            row_data['sev_severity'],
                                            row_data['sev_assignment'],
                                            row_data['sev_first_response'],
                                            row_data['sev_first_correction'],
                                            row_data['sev_final_response'] )


        return problem_report
Ejemplo n.º 4
0
    def __init__(self, rowId=None, problem_id=None, title=None, created=None, closed=None,reported_by=None, description=None,
                       release_id=None, pronto_state_id=None, environment_id=None, fault_analysis_state_id=None, correction_plan_state_id=None,
                       correction_response_state_id=None, correction_workaround_state_id=None, user_id=None, severity_id=None):
        self.id           = rowId
        self.problem_id   = problem_id
        self.title        = title
        self.created      = dateTime2IsoString(created)
        self.closed       = dateTime2IsoString(closed)
        self.reported_by  = reported_by
        self.description  = description

        self.release_id                     = release_id
        self.pronto_state_id                = pronto_state_id
        self.environment_id                 = environment_id
        self.fault_analysis_state_id        = fault_analysis_state_id
        self.correction_plan_state_id       = correction_plan_state_id
        self.correction_response_state_id   = correction_response_state_id
        self.correction_workaround_state_id = correction_workaround_state_id
        self.user_id                        = user_id
        self.severity_id                    = severity_id
Ejemplo n.º 5
0
def test_dateTime2IsoString():
    dt = datetime.datetime(2016, 1, 1, 12, 12, 12, 0, TZ_UTC)
    assert datetime_utils.dateTime2IsoString(dt) == "2016-01-01T12:12:12+00:00"
    assert datetime_utils.dateTime2IsoString("NOT_A_DATE") == None