Exemplo n.º 1
0
 def test_collection(self):
     try:
         CollectorTest.Tester().test()
     except Exception as e:
         report = catcher.collect(e)
     html = catcher.formatters.HTMLFormatter().format(report)
     print(catcher.uploaders.AjentiOrgUploader().upload(html))
Exemplo n.º 2
0
def make_report(e):
    """
    Formats a bug report.
    """
    import platform as _platform
    from ajenti.plugins import manager
    from ajenti import platform, platform_unmapped, platform_string, installation_uid, version, debug

    # Finalize the reported log
    logging.blackbox.stop()

    tb = traceback.format_exc(e)
    tb = '\n'.join('    ' + x for x in tb.splitlines())
    log = logging.blackbox.buffer
    log = '\n'.join('    ' + x for x in log.splitlines())

    catcher_url = None
    try:
        report = catcher.collect(e)
        html = catcher.formatters.HTMLFormatter().format(report, maxdepth=3)
        catcher_url = catcher.uploaders.AjentiOrgUploader().upload(html)
    except:
        pass

    return """Ajenti bug report
--------------------


Info | Value
----- | -----
Ajenti | %s
Platform | %s / %s / %s
Architecture | %s
Python | %s
Installation | %s
Debug | %s
Catcher report | %s
Loaded plugins | %s

%s

Log content:

%s
            """ % (
        version,
        platform, platform_unmapped, platform_string.strip(),
        subprocess.check_output(['uname', '-mp']).strip(),
        '.'.join([str(x) for x in _platform.python_version_tuple()]),
        installation_uid,
        debug,
        catcher_url or 'Failed to upload traceback',
        ', '.join(sorted(manager.get_order())),
        tb,
        log,
    )
Exemplo n.º 3
0
def make_report(e):
    """
    Formats a bug report.
    """
    import platform as _platform
    from ajenti.plugins import manager
    from ajenti import platform, platform_unmapped, platform_string, installation_uid, version, debug

    # Finalize the reported log
    logging.blackbox.stop()

    tb = traceback.format_exc(e)

    catcher_url = None
    try:
        report = catcher.collect(e)
        html = catcher.formatters.HTMLFormatter().format(report, maxdepth=3)
        catcher_url = catcher.uploaders.AjentiOrgUploader().upload(html)
    except:
        pass

    return """Ajenti %s bug report
--------------------
Detected platform: %s / %s / %s
Architecture: %s
Python: %s
Installation: %s
Debug: %s
Locale: %s
Loaded plugins:
%s

%s
%s

Log content:
%s
            """ % (
        version,
        platform,
        platform_unmapped,
        platform_string,
        subprocess.check_output(['uname', '-mp']),
        '.'.join([str(x) for x in _platform.python_version_tuple()]),
        installation_uid,
        debug,
        locale.getlocale(locale.LC_MESSAGES),
        ' '.join(manager.get_order()),
        tb,
        catcher_url or 'Failed to upload traceback',
        logging.blackbox.buffer,
    )
Exemplo n.º 4
0
def make_report(e):
    """
    Formats a bug report.
    """
    import platform as _platform
    from ajenti.plugins import manager
    from ajenti import platform, platform_unmapped, platform_string, installation_uid, version, debug

    # Finalize the reported log
    logging.blackbox.stop()

    tb = traceback.format_exc(e)
    
    catcher_url = None
    try:
        report = catcher.collect(e)
        html = catcher.formatters.HTMLFormatter().format(report, maxdepth=3)
        catcher_url = catcher.uploaders.AjentiOrgUploader().upload(html)
    except:
        pass

    return """Ajenti %s bug report
--------------------
Detected platform: %s / %s / %s
Architecture: %s
Python: %s
Installation: %s
Debug: %s
Locale: %s
Loaded plugins:
%s

%s
%s

Log content:
%s
            """ % (
        version,
        platform, platform_unmapped, platform_string,
        subprocess.check_output(['uname', '-mp']),
        '.'.join([str(x) for x in _platform.python_version_tuple()]),
        installation_uid,
        debug,
        locale.getlocale(locale.LC_MESSAGES),
        ' '.join(manager.get_order()),
        tb,
        catcher_url or 'Failed to upload traceback',
        logging.blackbox.buffer,
    )
Exemplo n.º 5
0
 def test_collection(self):
     try:
         CollectorTest.Tester().test()
     except Exception, e:
         report = catcher.collect(e)
Exemplo n.º 6
0
def make_report(e):
    """
    Formats a bug report.
    """
    import platform as _platform
    from ajenti.plugins import manager
    from ajenti import platform, platform_unmapped, platform_string, installation_uid, version, debug

    # Finalize the reported log
    logging.blackbox.stop()

    tb = traceback.format_exc(e)
    tb = '\n'.join('    ' + x for x in tb.splitlines())
    log = logging.blackbox.buffer
    log = '\n'.join('    ' + x for x in log.splitlines())

    catcher_url = None
    try:
        report = catcher.collect(e)
        html = catcher.formatters.HTMLFormatter().format(report, maxdepth=3)
        catcher_url = catcher.uploaders.AjentiOrgUploader().upload(html)
    except:
        pass

    import gevent
    import greenlet
    import reconfigure
    import requests
    import psutil

    return """Ajenti bug report
--------------------


Info | Value
----- | -----
Ajenti | %s
Platform | %s / %s / %s
Architecture | %s
Python | %s
Installation | %s
Debug | %s
Catcher report | %s
Loaded plugins | %s

Library | Version
------- | -------
gevent | %s
greenlet | %s
reconfigure | %s
requests | %s
psutil | %s


%s

Log content:

%s
            """ % (
        version,
        platform,
        platform_unmapped,
        platform_string.strip(),
        subprocess.check_output(['uname', '-mp']).strip(),
        '.'.join([str(x) for x in _platform.python_version_tuple()]),
        installation_uid,
        debug,
        catcher_url or 'Failed to upload traceback',
        ', '.join(sorted(manager.get_order())),
        gevent.__version__,
        greenlet.__version__,
        reconfigure.__version__,
        requests.__version__,
        psutil.__version__,
        tb,
        log,
    )