~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

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
 
        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
 
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
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
 
            return open(requirements_file, 'r').read().split('\n')
 
57
            with open(requirements_file, 'r') as fil:
 
58
                return fil.read().split('\n')
58
59
    return []
59
60
 
60
61
 
116
117
 
117
118
 
118
119
def _run_shell_command(cmd):
119
 
    output = subprocess.Popen(["/bin/sh", "-c", cmd],
120
 
                              stdout=subprocess.PIPE)
 
120
    if os.name == 'nt':
 
121
        output = subprocess.Popen(["cmd.exe", "/C", cmd],
 
122
                                  stdout=subprocess.PIPE)
 
123
    else:
 
124
        output = subprocess.Popen(["/bin/sh", "-c", cmd],
 
125
                                  stdout=subprocess.PIPE)
121
126
    out = output.communicate()
122
127
    if len(out) == 0:
123
128
        return None
135
140
    _run_shell_command("git fetch origin +refs/meta/*:refs/remotes/meta/*")
136
141
    milestone_cmd = "git show meta/openstack/release:%s" % branch_name
137
142
    milestonever = _run_shell_command(milestone_cmd)
138
 
    if not milestonever:
139
 
        milestonever = ""
 
143
    if milestonever:
 
144
        first_half = "%s~%s" % (milestonever, datestamp)
 
145
    else:
 
146
        first_half = datestamp
 
147
 
140
148
    post_version = _get_git_post_version()
141
149
    # post version should look like:
142
150
    # 0.1.1.4.gcc9e28a
143
151
    # where the bit after the last . is the short sha, and the bit between
144
152
    # the last and second to last is the revno count
145
153
    (revno, sha) = post_version.split(".")[-2:]
146
 
    first_half = "%s~%s" % (milestonever, datestamp)
147
154
    second_half = "%s%s.%s" % (revno_prefix, revno, sha)
148
155
    return ".".join((first_half, second_half))
149
156
 
191
198
 
192
199
def generate_authors():
193
200
    """Create AUTHORS file using git commits."""
194
 
    jenkins_email = 'jenkins@review.openstack.org'
 
201
    jenkins_email = 'jenkins@review.(openstack|stackforge).org'
195
202
    old_authors = 'AUTHORS.in'
196
203
    new_authors = 'AUTHORS'
197
204
    if not os.getenv('SKIP_GENERATE_AUTHORS'):
198
205
        if os.path.isdir('.git'):
199
206
            # don't include jenkins email address in AUTHORS file
200
207
            git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
201
 
                           "grep -v " + jenkins_email)
 
208
                           "egrep -v '" + jenkins_email + "'")
202
209
            changelog = _run_shell_command(git_log_cmd)
203
210
            mailmap = parse_mailmap()
204
211
            with open(new_authors, 'w') as new_authors_fh:
236
243
 
237
244
def write_versioninfo(project, version):
238
245
    """Write a simple file containing the version of the package."""
239
 
    open(os.path.join(project, 'versioninfo'), 'w').write("%s\n" % version)
 
246
    with open(os.path.join(project, 'versioninfo'), 'w') as fil:
 
247
        fil.write("%s\n" % version)
240
248
 
241
249
 
242
250
def get_cmdclass():