summaryrefslogtreecommitdiffstats
path: root/__init__.py
blob: 48986f336c434d30e1309c944abec79dceb33fcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: UTF-8 -*-
version = '0.1'
copyright = """\
Copyright 2014 Red Hat, Inc.
Licensed under GPLv2
""".rstrip()
# XXX eventually there should be precise plugin authorship tracking
author = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com> and plugin authors"

metadata = (version, copyright, author)

description = """\
Tool to perform various transformations on cluster configuration formats.

Primarily aimed at (CMAN, rgmanager) -> (Corosync, Pacemaker) cluster
stacks configuration conversion (following RHEL trend), the tool,
however, offers more uses further extensible within the arranged
commands-filters-formats plugin framework.
"""
#Native plugins allows also for obfuscation of sensitive data within
#cluster configuration of supported cluster stacks, and other
#convenient actions.

_deobfuscate_mail = (lambda what: what.replace(' @at@ ', '@')
                                      .replace(' .dot. ', '.')
                                      .replace('@Red Hat.', '@redhat.'))


def version_text(package=None, sep='\n'):
    if package is None:
        from os.path import basename, dirname
        package = basename(dirname(__file__))
    return (package + ' '
            + _deobfuscate_mail(sep.join(metadata).replace(' \n', '\n')))


def description_text(width=76):
    if not width:
        return description
    from textwrap import fill
    desc = map(lambda p: p.replace('\n', ' '), description.split('\n\n'))
    return '\n\n'.join(map(lambda p: fill(p, width), desc)) + '\n'