~zulcss/cinder/cinder-ca-g2

« back to all changes in this revision

Viewing changes to cinder/openstack/common/setup.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-10-09 08:26:21 UTC
  • mfrom: (3.1.10 quantal)
  • Revision ID: package-import@ubuntu.com-20121009082621-stc86vcuyzyrp7ow
Tags: 2012.2-0ubuntu2
* debian/cinder_tgt.conf: Add missing configuration file. (LP: #1064366) 
* debian/README.Debian: Added note about migration from nova-volume
  to cinder-volume.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
def parse_mailmap(mailmap='.mailmap'):
32
32
    mapping = {}
33
33
    if os.path.exists(mailmap):
34
 
        with open(mailmap, 'r') as fp:
35
 
            for l in fp:
36
 
                l = l.strip()
37
 
                if not l.startswith('#') and ' ' in l:
38
 
                    canonical_email, alias = [x for x in l.split(' ')
39
 
                                              if x.startswith('<')]
40
 
                    mapping[alias] = canonical_email
 
34
        fp = open(mailmap, 'r')
 
35
        for l in fp:
 
36
            l = l.strip()
 
37
            if not l.startswith('#') and ' ' in l:
 
38
                canonical_email, alias = [x for x in l.split(' ')
 
39
                                          if x.startswith('<')]
 
40
                mapping[alias] = canonical_email
41
41
    return mapping
42
42
 
43
43
 
54
54
def get_reqs_from_files(requirements_files):
55
55
    for requirements_file in requirements_files:
56
56
        if os.path.exists(requirements_file):
57
 
            with open(requirements_file, 'r') as fil:
58
 
                return fil.read().split('\n')
 
57
            return open(requirements_file, 'r').read().split('\n')
59
58
    return []
60
59
 
61
60
 
192
191
 
193
192
def generate_authors():
194
193
    """Create AUTHORS file using git commits."""
195
 
    jenkins_email = 'jenkins@review.(openstack|stackforge).org'
 
194
    jenkins_email = 'jenkins@review.openstack.org'
196
195
    old_authors = 'AUTHORS.in'
197
196
    new_authors = 'AUTHORS'
198
197
    if not os.getenv('SKIP_GENERATE_AUTHORS'):
199
198
        if os.path.isdir('.git'):
200
199
            # don't include jenkins email address in AUTHORS file
201
200
            git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
202
 
                           "egrep -v '" + jenkins_email + "'")
 
201
                           "grep -v " + jenkins_email)
203
202
            changelog = _run_shell_command(git_log_cmd)
204
203
            mailmap = parse_mailmap()
205
204
            with open(new_authors, 'w') as new_authors_fh:
237
236
 
238
237
def write_versioninfo(project, version):
239
238
    """Write a simple file containing the version of the package."""
240
 
    with open(os.path.join(project, 'versioninfo'), 'w') as fil:
241
 
        fil.write("%s\n" % version)
 
239
    open(os.path.join(project, 'versioninfo'), 'w').write("%s\n" % version)
242
240
 
243
241
 
244
242
def get_cmdclass():