Remove identical modules versions.py

This patch removes identical modules versions.py
in heat/api, moves this module to heat/api/versions.py
and fix imports for new path of module.

Change-Id: I9f92a9c07aaf5d2283af8642cdffc4c958e5b96b
changes/32/188032/2
Peter Razumovsky 7 years ago
parent 25cff7933d
commit 5e901f0936
  1. 47
      heat/api/cfn/versions.py
  2. 2
      heat/api/cloudwatch/__init__.py
  3. 47
      heat/api/openstack/versions.py
  4. 0
      heat/api/versions.py

@ -11,46 +11,11 @@
# License for the specific language governing permissions and limitations
# under the License.
"""
Controller that returns information on the heat API versions
"""
from oslo_serialization import jsonutils
from six.moves import http_client
import webob.dec
class Controller(object):
"""
A controller that produces information on the heat API versions.
"""
"""Controller that returns information on the heat API versions.
def __init__(self, conf):
self.conf = conf
@webob.dec.wsgify
def __call__(self, req):
"""Respond to a request for all OpenStack API versions."""
version_objs = [
{
"id": "v1.0",
"status": "CURRENT",
"links": [
{
"rel": "self",
"href": self.get_href(req)
}]
}]
body = jsonutils.dumps(dict(versions=version_objs))
response = webob.Response(request=req,
status=http_client.MULTIPLE_CHOICES,
content_type='application/json')
response.body = body
return response
Now it's an subclass of module versions, because of identity with openstack
module versions.
"""
from heat.api import versions
def get_href(self, req):
return "%s/v1/" % req.host_url
Controller = versions.Controller

@ -14,9 +14,9 @@
import routes
import webob
from heat.api.cloudwatch import versions
from heat.api.cloudwatch import watch
from heat.api.middleware import version_negotiation as vn
from heat.api import versions
from heat.common import wsgi

@ -11,46 +11,11 @@
# License for the specific language governing permissions and limitations
# under the License.
"""
Controller that returns information on the heat API versions
"""
from oslo_serialization import jsonutils
from six.moves import http_client
import webob.dec
class Controller(object):
"""
A controller that produces information on the heat API versions.
"""
"""Controller that returns information on the heat API versions.
def __init__(self, conf):
self.conf = conf
@webob.dec.wsgify
def __call__(self, req):
"""Respond to a request for all OpenStack API versions."""
version_objs = [
{
"id": "v1.0",
"status": "CURRENT",
"links": [
{
"rel": "self",
"href": self.get_href(req)
}]
}]
body = jsonutils.dumps(dict(versions=version_objs))
response = webob.Response(request=req,
status=http_client.MULTIPLE_CHOICES,
content_type='application/json')
response.body = body
return response
Now it's an subclass of module versions, because of identity with cfn module
versions. It can be changed, if there will be another API version.
"""
from heat.api import versions
def get_href(self, req):
return "%s/v1/" % req.host_url
Controller = versions.Controller

Loading…
Cancel
Save