~ubuntu-branches/ubuntu/trusty/python-cinderclient/trusty

« back to all changes in this revision

Viewing changes to tools/install_venv_common.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-03-06 15:15:14 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140306151514-ihbixyaopbhaqdju
Tags: 1:1.0.8-0ubuntu1
* New upstream release.
* debian/patches/fix-search-opts.patch: Dropped no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
 
 
3
1
# Copyright 2013 OpenStack Foundation
4
2
# Copyright 2013 IBM Corp.
5
3
#
121
119
 
122
120
        self.pip_install('-r', self.requirements, '-r', self.test_requirements)
123
121
 
124
 
    def post_process(self):
125
 
        self.get_distro().post_process()
126
 
 
127
122
    def parse_args(self, argv):
128
123
        """Parses command-line arguments."""
129
124
        parser = optparse.OptionParser()
156
151
                 ' requires virtualenv, please install it using your'
157
152
                 ' favorite package management tool' % self.project)
158
153
 
159
 
    def post_process(self):
160
 
        """Any distribution-specific post-processing gets done here.
161
 
 
162
 
        In particular, this is useful for applying patches to code inside
163
 
        the venv.
164
 
        """
165
 
        pass
166
 
 
167
154
 
168
155
class Fedora(Distro):
169
156
    """This covers all Fedora-based distributions.
175
162
        return self.run_command_with_code(['rpm', '-q', pkg],
176
163
                                          check_exit_code=False)[1] == 0
177
164
 
178
 
    def apply_patch(self, originalfile, patchfile):
179
 
        self.run_command(['patch', '-N', originalfile, patchfile],
180
 
                         check_exit_code=False)
181
 
 
182
165
    def install_virtualenv(self):
183
166
        if self.check_cmd('virtualenv'):
184
167
            return
187
170
            self.die("Please install 'python-virtualenv'.")
188
171
 
189
172
        super(Fedora, self).install_virtualenv()
190
 
 
191
 
    def post_process(self):
192
 
        """Workaround for a bug in eventlet.
193
 
 
194
 
        This currently affects RHEL6.1, but the fix can safely be
195
 
        applied to all RHEL and Fedora distributions.
196
 
 
197
 
        This can be removed when the fix is applied upstream.
198
 
 
199
 
        Nova: https://bugs.launchpad.net/nova/+bug/884915
200
 
        Upstream: https://bitbucket.org/eventlet/eventlet/issue/89
201
 
        RHEL: https://bugzilla.redhat.com/958868
202
 
        """
203
 
 
204
 
        if os.path.exists('contrib/redhat-eventlet.patch'):
205
 
            # Install "patch" program if it's not there
206
 
            if not self.check_pkg('patch'):
207
 
                self.die("Please install 'patch'.")
208
 
 
209
 
            # Apply the eventlet patch
210
 
            self.apply_patch(os.path.join(self.venv, 'lib', self.py_version,
211
 
                                          'site-packages',
212
 
                                          'eventlet/green/subprocess.py'),
213
 
                             'contrib/redhat-eventlet.patch')