diff options
author | Chris Yeoh <cyeoh@au1.ibm.com> | 2013-06-13 15:05:00 +0930 |
---|---|---|
committer | Chris Yeoh <cyeoh@au1.ibm.com> | 2013-06-15 17:57:11 +0930 |
commit | 198a915f21f0ed9dfcfa74cc16ad173253047d8f (patch) | |
tree | 43d8c510c4912462ebca07462064b5d6d7490cf1 | |
parent | d3dbc09ae0b020d42e776dd7d3aa920b13c02837 (diff) | |
download | nova-198a915f21f0ed9dfcfa74cc16ad173253047d8f.tar.gz nova-198a915f21f0ed9dfcfa74cc16ad173253047d8f.tar.xz nova-198a915f21f0ed9dfcfa74cc16ad173253047d8f.zip |
Cleanup certificate API extension
Fixes a couple of minor issues with the v2 and v3 versions
of the certificate API extension identified during the
v2->v3 port
* Removes unused CertificatesTemplate class
* Corrects doc strings for a couple of methods
Change-Id: If022d2393ceab5ce7e6311c92a6f52b6325039bc
-rw-r--r-- | nova/api/openstack/compute/contrib/certificates.py | 13 | ||||
-rw-r--r-- | nova/api/openstack/compute/plugins/v3/certificates.py | 13 |
2 files changed, 4 insertions, 22 deletions
diff --git a/nova/api/openstack/compute/contrib/certificates.py b/nova/api/openstack/compute/contrib/certificates.py index 64a6e26fe..4fe49aadf 100644 --- a/nova/api/openstack/compute/contrib/certificates.py +++ b/nova/api/openstack/compute/contrib/certificates.py @@ -38,15 +38,6 @@ class CertificateTemplate(xmlutil.TemplateBuilder): return xmlutil.MasterTemplate(root, 1) -class CertificatesTemplate(xmlutil.TemplateBuilder): - def construct(self): - root = xmlutil.TemplateElement('certificates') - elem = xmlutil.SubTemplateElement(root, 'certificate', - selector='certificates') - make_certificate(elem) - return xmlutil.MasterTemplate(root, 1) - - def _translate_certificate_view(certificate, private_key=None): return { 'data': certificate, @@ -64,7 +55,7 @@ class CertificatesController(object): @wsgi.serializers(xml=CertificateTemplate) def show(self, req, id): - """Return a list of certificates.""" + """Return certificate information.""" context = req.environ['nova.context'] authorize(context) if id != 'root': @@ -76,7 +67,7 @@ class CertificatesController(object): @wsgi.serializers(xml=CertificateTemplate) def create(self, req, body=None): - """Return a list of certificates.""" + """Create a certificate.""" context = req.environ['nova.context'] authorize(context) pk, cert = self.cert_rpcapi.generate_x509_cert(context, diff --git a/nova/api/openstack/compute/plugins/v3/certificates.py b/nova/api/openstack/compute/plugins/v3/certificates.py index 4af679ebe..175780f9c 100644 --- a/nova/api/openstack/compute/plugins/v3/certificates.py +++ b/nova/api/openstack/compute/plugins/v3/certificates.py @@ -39,15 +39,6 @@ class CertificateTemplate(xmlutil.TemplateBuilder): return xmlutil.MasterTemplate(root, 1) -class CertificatesTemplate(xmlutil.TemplateBuilder): - def construct(self): - root = xmlutil.TemplateElement('certificates') - elem = xmlutil.SubTemplateElement(root, 'certificate', - selector='certificates') - make_certificate(elem) - return xmlutil.MasterTemplate(root, 1) - - def _translate_certificate_view(certificate, private_key=None): return { 'data': certificate, @@ -65,7 +56,7 @@ class CertificatesController(object): @wsgi.serializers(xml=CertificateTemplate) def show(self, req, id): - """Return a list of certificates.""" + """Return certificate information.""" context = req.environ['nova.context'] authorize(context) if id != 'root': @@ -77,7 +68,7 @@ class CertificatesController(object): @wsgi.serializers(xml=CertificateTemplate) def create(self, req, body=None): - """Return a list of certificates.""" + """Create a certificate.""" context = req.environ['nova.context'] authorize(context) pk, cert = self.cert_rpcapi.generate_x509_cert(context, |