~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/api/openstack/compute/views/versions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Soren Hansen
  • Date: 2012-09-07 17:49:53 UTC
  • mfrom: (1.1.61)
  • Revision ID: package-import@ubuntu.com-20120907174953-oapuvix1jxm830he
Tags: 2012.2~rc1~20120907.15996-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/nova-common.postinst: Drop nova_sudoers permission changing
  since we do it in the debian/rules. (LP: #995285)

[ Soren Hansen ]
* Update debian/watch to account for symbolically named tarballs and
  use newer URL.
* Fix Launchpad URLs in debian/watch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import copy
19
19
import os
20
20
 
 
21
from nova.api.openstack import common
 
22
from nova import flags
 
23
 
 
24
 
 
25
FLAGS = flags.FLAGS
 
26
 
21
27
 
22
28
def get_view_builder(req):
23
29
    base_url = req.application_url
24
30
    return ViewBuilder(base_url)
25
31
 
26
32
 
27
 
class ViewBuilder(object):
 
33
class ViewBuilder(common.ViewBuilder):
28
34
 
29
35
    def __init__(self, base_url):
30
36
        """
86
92
 
87
93
    def generate_href(self, path=None):
88
94
        """Create an url that refers to a specific version_number."""
 
95
        prefix = self._update_link_prefix(self.base_url,
 
96
                                          FLAGS.osapi_compute_link_prefix)
89
97
        version_number = 'v2'
90
98
        if path:
91
99
            path = path.strip('/')
92
 
            return os.path.join(self.base_url, version_number, path)
 
100
            return os.path.join(prefix, version_number, path)
93
101
        else:
94
 
            return os.path.join(self.base_url, version_number) + '/'
 
102
            return os.path.join(prefix, version_number) + '/'