launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #06494
[Merge] lp:~allenap/maas/normalize-spelling into lp:maas
Gavin Panella has proposed merging lp:~allenap/maas/normalize-spelling into lp:maas.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/maas/normalize-spelling/+merge/94589
--
https://code.launchpad.net/~allenap/maas/normalize-spelling/+merge/94589
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/maas/normalize-spelling into lp:maas.
=== modified file 'LICENSE'
--- LICENSE 2012-02-16 21:21:43 +0000
+++ LICENSE 2012-02-24 17:43:20 +0000
@@ -1,6 +1,6 @@
-Maas is Copyright 2012 Canonical Ltd.
+MaaS is Copyright 2012 Canonical Ltd.
-Canonical Ltd ("Canonical") distributes the Maas source code
+Canonical Ltd ("Canonical") distributes the MaaS source code
under the GNU Affero General Public License, version 3 ("AGPLv3").
The full text of this licence is given below.
=== modified file 'README.txt'
--- README.txt 2012-02-10 16:21:09 +0000
+++ README.txt 2012-02-24 17:43:20 +0000
@@ -2,7 +2,7 @@
MaaS
****
-Maas is the successor to Orchestra. It offers a nice UI to provision your
+MaaS is the successor to Orchestra. It offers a nice UI to provision your
Ubuntu servers. Each physical server (“node”) will
be commissioned automatically on first boot. During the commissioning
process administrators are able to configure hardware settings
=== modified file 'src/maas/api_auth.py'
--- src/maas/api_auth.py 2012-02-21 11:12:07 +0000
+++ src/maas/api_auth.py 2012-02-24 17:43:20 +0000
@@ -17,7 +17,7 @@
from piston.utils import rc
-class MaasAPIAuthentication(OAuthAuthentication):
+class MaaSAPIAuthentication(OAuthAuthentication):
"""A piston authentication class that uses the currently logged-in user
if there is one, and defaults to piston's OAuthAuthentication if not.
@@ -28,7 +28,7 @@
return request.user
else:
return super(
- MaasAPIAuthentication, self).is_authenticated(request)
+ MaaSAPIAuthentication, self).is_authenticated(request)
def challenge(self):
# Beware: this returns 401: Unauthorized, not 403: Forbidden
@@ -37,4 +37,4 @@
# OAuth authentication for the APIs.
-api_auth = MaasAPIAuthentication(realm="MaaS API")
+api_auth = MaaSAPIAuthentication(realm="MaaS API")
=== modified file 'src/maasserver/api.py'
--- src/maasserver/api.py 2012-02-24 14:58:22 +0000
+++ src/maasserver/api.py 2012-02-24 17:43:20 +0000
@@ -37,8 +37,8 @@
from django.template import RequestContext
from docutils import core
from maasserver.exceptions import (
- MaasAPIBadRequest,
- MaasAPINotFound,
+ MaaSAPIBadRequest,
+ MaaSAPINotFound,
NodesNotAvailable,
PermissionDenied,
)
@@ -394,11 +394,11 @@
"""
filename = request.GET.get("filename", None)
if not filename:
- raise MaasAPIBadRequest("Filename not supplied")
+ raise MaaSAPIBadRequest("Filename not supplied")
try:
db_file = FileStorage.objects.get(filename=filename)
except FileStorage.DoesNotExist:
- raise MaasAPINotFound("File not found")
+ raise MaaSAPINotFound("File not found")
return HttpResponse(db_file.data.read(), status=httplib.OK)
@api_exported('add', 'POST')
@@ -412,12 +412,12 @@
"""
filename = request.data.get("filename", None)
if not filename:
- raise MaasAPIBadRequest("Filename not supplied")
+ raise MaaSAPIBadRequest("Filename not supplied")
files = request.FILES
if not files:
- raise MaasAPIBadRequest("File not supplied")
+ raise MaaSAPIBadRequest("File not supplied")
if len(files) != 1:
- raise MaasAPIBadRequest("Exactly one file must be supplied")
+ raise MaaSAPIBadRequest("Exactly one file must be supplied")
uploaded_file = files['file']
# As per the comment in FileStorage, this ought to deal in
=== modified file 'src/maasserver/exceptions.py'
--- src/maasserver/exceptions.py 2012-02-17 08:34:26 +0000
+++ src/maasserver/exceptions.py 2012-02-24 17:43:20 +0000
@@ -10,10 +10,10 @@
__metaclass__ = type
__all__ = [
- "MaasException",
- "MaasAPIBadRequest",
- "MaasAPIException",
- "MaasAPINotFound",
+ "MaaSException",
+ "MaaSAPIBadRequest",
+ "MaaSAPIException",
+ "MaaSAPINotFound",
"PermissionDenied",
]
@@ -21,16 +21,16 @@
import httplib
-class MaasException(Exception):
- """Base class for Maas' exceptions."""
+class MaaSException(Exception):
+ """Base class for MaaS' exceptions."""
class CannotDeleteUserException(Exception):
"""User can't be deleted."""
-class MaasAPIException(Exception):
- """Base class for Maas' API exceptions.
+class MaaSAPIException(Exception):
+ """Base class for MaaS' API exceptions.
:ivar api_error: The HTTP code that should be returned when this error
is raised in the API (defaults to 500: "Internal Server Error").
@@ -39,15 +39,15 @@
api_error = httplib.INTERNAL_SERVER_ERROR
-class MaasAPIBadRequest(MaasAPIException):
+class MaaSAPIBadRequest(MaaSAPIException):
api_error = httplib.BAD_REQUEST
-class MaasAPINotFound(MaasAPIException):
+class MaaSAPINotFound(MaaSAPIException):
api_error = httplib.NOT_FOUND
-class PermissionDenied(MaasAPIException):
+class PermissionDenied(MaaSAPIException):
"""HTTP error 403: Forbidden. User is logged in, but lacks permission.
Do not confuse this with 401: Unauthorized ("you need to be logged in
@@ -57,11 +57,11 @@
api_error = httplib.FORBIDDEN
-class Unauthorized(MaasAPIException):
+class Unauthorized(MaaSAPIException):
"""HTTP error 401: Unauthorized. Login required."""
api_error = httplib.UNAUTHORIZED
-class NodesNotAvailable(MaasAPIException):
+class NodesNotAvailable(MaaSAPIException):
"""Requested node(s) are not available to be acquired."""
api_error = httplib.CONFLICT
=== modified file 'src/maasserver/fixtures/dev_fixture.yaml'
--- src/maasserver/fixtures/dev_fixture.yaml 2012-02-16 11:48:57 +0000
+++ src/maasserver/fixtures/dev_fixture.yaml 2012-02-24 17:43:20 +0000
@@ -132,11 +132,11 @@
username: test
model: auth.user
pk: 106
-- fields: {description: '', key: RfGASHsLT6XwuRunC6, name: Maas consumer, secret: '', status: accepted,
+- fields: {description: '', key: RfGASHsLT6XwuRunC6, name: MaaS consumer, secret: '', status: accepted,
user: 101}
model: piston.consumer
pk: 1
-- fields: {description: '', key: JcaW54bSSN66wj5M3d, name: Maas consumer, secret: '', status: accepted,
+- fields: {description: '', key: JcaW54bSSN66wj5M3d, name: MaaS consumer, secret: '', status: accepted,
user: 105}
model: piston.consumer
pk: 2
=== modified file 'src/maasserver/middleware.py'
--- src/maasserver/middleware.py 2012-02-22 17:23:01 +0000
+++ src/maasserver/middleware.py 2012-02-24 17:43:20 +0000
@@ -31,7 +31,7 @@
HttpResponseRedirect,
)
from django.utils.http import urlquote_plus
-from maasserver.exceptions import MaasAPIException
+from maasserver.exceptions import MaaSAPIException
class AccessMiddleware:
@@ -77,7 +77,7 @@
class ExceptionMiddleware:
"""Convert exceptions into appropriate HttpResponse responses.
- For example, a MaasAPINotFound exception processed by a middleware
+ For example, a MaaSAPINotFound exception processed by a middleware
based on this class will result in an http 404 response to the client.
Validation errors become "bad request" responses.
@@ -106,8 +106,8 @@
return None
encoding = b'utf-8'
- if isinstance(exception, MaasAPIException):
- # The exception is a MaasAPIException: exception.api_error
+ if isinstance(exception, MaaSAPIException):
+ # The exception is a MaaSAPIException: exception.api_error
# will give us the proper error type.
return HttpResponse(
content=unicode(exception).encode(encoding),
=== modified file 'src/maasserver/models.py'
--- src/maasserver/models.py 2012-02-24 14:02:16 +0000
+++ src/maasserver/models.py 2012-02-24 17:43:20 +0000
@@ -398,7 +398,7 @@
return self.mac_address
-GENERIC_CONSUMER = 'Maas consumer'
+GENERIC_CONSUMER = 'MaaS consumer'
def create_auth_token(user):
@@ -459,7 +459,7 @@
class UserProfile(models.Model):
- """A User profile to store Maas specific methods and fields.
+ """A User profile to store MaaS specific methods and fields.
:ivar user: The related User_.
=== modified file 'src/maasserver/static/js/node_add.js'
--- src/maasserver/static/js/node_add.js 2012-02-21 18:20:40 +0000
+++ src/maasserver/static/js/node_add.js 2012-02-24 17:43:20 +0000
@@ -184,13 +184,13 @@
initializeNodes: function() {
// Prepare spinnerNode.
this.spinnerNode = Y.Node.create('<img />')
- .set('src', MAAS_config.uris.statics + 'img/spinner.gif');
+ .set('src', MaaS_config.uris.statics + 'img/spinner.gif');
// Prepare logged-off error message.
this.loggedOffNode = Y.Node.create('<span />')
.set('text', "You have been logged out, please ")
.append(Y.Node.create('<a />')
.set('text', 'log in')
- .set('href', MAAS_config.uris.login))
+ .set('href', MaaS_config.uris.login))
.append(Y.Node.create('<span />')
.set('text', ' again.'));
},
@@ -252,7 +252,7 @@
}
};
var request = module._io.send(
- MAAS_config.uris.nodes_handler, cfg);
+ MaaS_config.uris.nodes_handler, cfg);
}
});
=== modified file 'src/maasserver/static/js/node_views.js'
--- src/maasserver/static/js/node_views.js 2012-02-15 19:12:05 +0000
+++ src/maasserver/static/js/node_views.js 2012-02-24 17:43:20 +0000
@@ -97,7 +97,7 @@
}
};
var request = module._io.send(
- MAAS_config.uris.nodes_handler, cfg);
+ MaaS_config.uris.nodes_handler, cfg);
},
/**
@@ -154,7 +154,7 @@
this.append = config.append;
// Prepare spinnerNode.
this.spinnerNode = Y.Node.create('<img />')
- .set('src', MAAS_config.uris.statics + 'img/spinner.gif');
+ .set('src', MaaS_config.uris.statics + 'img/spinner.gif');
},
/**
=== modified file 'src/maasserver/static/js/prefs.js'
--- src/maasserver/static/js/prefs.js 2012-02-15 19:12:05 +0000
+++ src/maasserver/static/js/prefs.js 2012-02-24 17:43:20 +0000
@@ -44,7 +44,7 @@
this.status_node = Y.Node.create('<div />')
.set('id','create_error');
this.spinnerNode = Y.Node.create('<img />')
- .set('src', MAAS_config.uris.statics + 'img/spinner.gif');
+ .set('src', MaaS_config.uris.statics + 'img/spinner.gif');
this.get('srcNode').one('#token_creation_placeholder')
.append(this.create_link)
.append(this.status_node);
@@ -98,7 +98,7 @@
}
};
var request = module._io.send(
- MAAS_config.uris.account_handler, cfg);
+ MaaS_config.uris.account_handler, cfg);
},
showSpinner: function() {
@@ -142,7 +142,7 @@
.set('title', 'Delete token')
.set(
'src',
- MAAS_config.uris.statics + 'img/delete.png'))));
+ MaaS_config.uris.statics + 'img/delete.png'))));
tbody.append(row);
this.bindDeleteRow(row);
},
@@ -183,7 +183,7 @@
}
};
var request = module._io.send(
- MAAS_config.uris.account_handler, cfg);
+ MaaS_config.uris.account_handler, cfg);
}
});
=== modified file 'src/maasserver/static/js/tests/test_node_add.html'
--- src/maasserver/static/js/tests/test_node_add.html 2012-02-21 16:33:31 +0000
+++ src/maasserver/static/js/tests/test_node_add.html 2012-02-24 17:43:20 +0000
@@ -13,7 +13,7 @@
<script type="text/javascript" src="test_node_add.js"></script>
<script type="text/javascript">
<!--
- var MAAS_config = {
+ var MaaS_config = {
uris: {
login: '/login/',
statics: '/static/',
=== modified file 'src/maasserver/static/js/tests/test_node_add.js'
--- src/maasserver/static/js/tests/test_node_add.js 2012-02-24 10:58:30 +0000
+++ src/maasserver/static/js/tests/test_node_add.js 2012-02-24 17:43:20 +0000
@@ -18,7 +18,7 @@
var mockXhr = Y.Mock();
Y.Mock.expect(mockXhr, {
method: 'send',
- args: [MAAS_config.uris.nodes_handler, Y.Mock.Value.Any]
+ args: [MaaS_config.uris.nodes_handler, Y.Mock.Value.Any]
});
this.mockIO(mockXhr, module);
},
@@ -57,7 +57,7 @@
var mockXhr = Y.Mock();
Y.Mock.expect(mockXhr, {
method: 'send',
- args: [MAAS_config.uris.nodes_handler, Y.Mock.Value.Any]
+ args: [MaaS_config.uris.nodes_handler, Y.Mock.Value.Any]
});
this.mockIO(mockXhr, module);
module.showAddNodeWidget();
@@ -72,7 +72,7 @@
var mockXhr = Y.Mock();
Y.Mock.expect(mockXhr, {
method: 'send',
- args: [MAAS_config.uris.nodes_handler, Y.Mock.Value.Any]
+ args: [MaaS_config.uris.nodes_handler, Y.Mock.Value.Any]
});
this.mockIO(mockXhr, module);
module.showAddNodeWidget();
@@ -142,7 +142,7 @@
var error_message = panel.get(
'srcNode').one('.form-global-errors').get('innerHTML');
// The link to the login page is present in the error message.
- var link_position = error_message.search(MAAS_config.uris.login);
+ var link_position = error_message.search(MaaS_config.uris.login);
Y.Assert.areNotEqual(-1, link_position);
}
=== modified file 'src/maasserver/static/js/tests/test_node_views.html'
--- src/maasserver/static/js/tests/test_node_views.html 2012-02-03 14:39:50 +0000
+++ src/maasserver/static/js/tests/test_node_views.html 2012-02-24 17:43:20 +0000
@@ -15,7 +15,7 @@
<script type="text/javascript" src="test_node_views.js"></script>
<script type="text/javascript">
<!--
- var MAAS_config = {
+ var MaaS_config = {
uris: {
statics: '/static/',
nodes_handler: '/api/nodes/'
=== modified file 'src/maasserver/static/js/tests/test_node_views.js'
--- src/maasserver/static/js/tests/test_node_views.js 2012-02-15 19:12:05 +0000
+++ src/maasserver/static/js/tests/test_node_views.js 2012-02-24 17:43:20 +0000
@@ -26,7 +26,7 @@
var mockXhr = Y.Mock();
Y.Mock.expect(mockXhr, {
method: 'send',
- args: [MAAS_config.uris.nodes_handler, Y.Mock.Value.Any]
+ args: [MaaS_config.uris.nodes_handler, Y.Mock.Value.Any]
});
this.mockIO(mockXhr, module);
=== modified file 'src/maasserver/static/js/tests/test_prefs.html'
--- src/maasserver/static/js/tests/test_prefs.html 2012-02-14 09:27:34 +0000
+++ src/maasserver/static/js/tests/test_prefs.html 2012-02-24 17:43:20 +0000
@@ -13,7 +13,7 @@
<script type="text/javascript" src="test_prefs.js"></script>
<script type="text/javascript">
<!--
- var MAAS_config = {
+ var MaaS_config = {
uris: {
statics: '/static/',
account_handler: '/api/accounts/prefs/'
=== modified file 'src/maasserver/static/js/tests/test_prefs.js'
--- src/maasserver/static/js/tests/test_prefs.js 2012-02-15 19:27:11 +0000
+++ src/maasserver/static/js/tests/test_prefs.js 2012-02-24 17:43:20 +0000
@@ -49,7 +49,7 @@
var fired = false;
mockXhr.send = function(url, cfg) {
fired = true;
- Y.Assert.areEqual(MAAS_config.uris.account_handler, url);
+ Y.Assert.areEqual(MaaS_config.uris.account_handler, url);
Y.Assert.areEqual(
"op=delete_authorisation_token&token_key=tokenkey1",
cfg.data);
@@ -120,7 +120,7 @@
var fired = false;
mockXhr.send = function(url, cfg) {
fired = true;
- Y.Assert.areEqual(MAAS_config.uris.account_handler, url);
+ Y.Assert.areEqual(MaaS_config.uris.account_handler, url);
Y.Assert.areEqual(
"op=create_authorisation_token",
cfg.data);
=== modified file 'src/maasserver/static/js/utils.js'
--- src/maasserver/static/js/utils.js 2012-02-20 11:07:00 +0000
+++ src/maasserver/static/js/utils.js 2012-02-24 17:43:20 +0000
@@ -1,7 +1,7 @@
/* Copyright 2012 Canonical Ltd. This software is licensed under the
* GNU Affero General Public License version 3 (see the file LICENSE).
*
- * Maas utilities.
+ * MaaS utilities.
*
* @module Y.mass.utils
*/
=== modified file 'src/maasserver/templates/maasserver/js-conf.html'
--- src/maasserver/templates/maasserver/js-conf.html 2012-02-21 23:16:08 +0000
+++ src/maasserver/templates/maasserver/js-conf.html 2012-02-24 17:43:20 +0000
@@ -5,7 +5,7 @@
combine: {% if YUI_DEBUG %}true{% else %}false{% endif %},
base: '{{ STATIC_URL }}js/yui/{{ YUI_VERSION }}/'
};
-var MAAS_config = {
+var MaaS_config = {
uris: {
login: '{% url "login" %}',
statics: '{{ STATIC_URL }}',
=== modified file 'src/maasserver/templates/maasserver/settings.html'
--- src/maasserver/templates/maasserver/settings.html 2012-02-20 11:02:48 +0000
+++ src/maasserver/templates/maasserver/settings.html 2012-02-24 17:43:20 +0000
@@ -83,7 +83,7 @@
<a href="{% url 'accounts-add' %}">Add user</a>
</div>
<div id="maas">
- #TODO Maas prefs
+ #TODO MaaS prefs
</div>
</div>
</div>
=== modified file 'src/maasserver/tests/test_middleware.py'
--- src/maasserver/tests/test_middleware.py 2012-02-22 13:56:02 +0000
+++ src/maasserver/tests/test_middleware.py 2012-02-24 17:43:20 +0000
@@ -17,8 +17,8 @@
from django.core.exceptions import ValidationError
from django.test.client import RequestFactory
from maasserver.exceptions import (
- MaasAPIException,
- MaasAPINotFound,
+ MaaSAPIException,
+ MaaSAPINotFound,
)
from maasserver.middleware import (
APIErrorsMiddleware,
@@ -68,7 +68,7 @@
def test_ignores_paths_outside_path_regex(self):
middleware = self.make_middleware(self.make_base_path())
request = fake_request(self.make_base_path())
- exception = MaasAPINotFound("Huh?")
+ exception = MaaSAPINotFound("Huh?")
self.assertIsNone(middleware.process_exception(request, exception))
def test_ignores_unknown_exception(self):
@@ -77,8 +77,8 @@
self.assertIsNone(
self.process_exception(ValueError("Error occurred!")))
- def test_reports_MaasAPIException_with_appropriate_api_error(self):
- class MyException(MaasAPIException):
+ def test_reports_MaaSAPIException_with_appropriate_api_error(self):
+ class MyException(MaaSAPIException):
api_error = httplib.UNAUTHORIZED
exception = MyException("Error occurred!")
@@ -87,8 +87,8 @@
(httplib.UNAUTHORIZED, "Error occurred!"),
(response.status_code, response.content))
- def test_renders_MaasAPIException_as_unicode(self):
- class MyException(MaasAPIException):
+ def test_renders_MaaSAPIException_as_unicode(self):
+ class MyException(MaaSAPIException):
api_error = httplib.UNAUTHORIZED
error_message = "Error %s" % unichr(233)
@@ -117,7 +117,7 @@
def test_handles_error_on_API(self):
middleware = APIErrorsMiddleware()
non_api_request = fake_request("/api/hello")
- exception = MaasAPINotFound("Have you looked under the couch?")
+ exception = MaaSAPINotFound("Have you looked under the couch?")
response = middleware.process_exception(non_api_request, exception)
self.assertEqual(
(httplib.NOT_FOUND, "Have you looked under the couch?"),
@@ -126,6 +126,6 @@
def test_ignores_error_outside_API(self):
middleware = APIErrorsMiddleware()
non_api_request = fake_request("/middleware/api/hello")
- exception = MaasAPINotFound("Have you looked under the couch?")
+ exception = MaaSAPINotFound("Have you looked under the couch?")
self.assertIsNone(
middleware.process_exception(non_api_request, exception))
=== modified file 'src/metadataserver/api.py'
--- src/metadataserver/api.py 2012-02-22 18:43:21 +0000
+++ src/metadataserver/api.py 2012-02-24 17:43:20 +0000
@@ -18,7 +18,7 @@
from django.http import HttpResponse
from maasserver.exceptions import (
- MaasAPINotFound,
+ MaaSAPINotFound,
PermissionDenied,
Unauthorized,
)
@@ -26,11 +26,11 @@
from piston.handler import BaseHandler
-class UnknownMetadataVersion(MaasAPINotFound):
+class UnknownMetadataVersion(MaaSAPINotFound):
"""Not a known metadata version."""
-class UnknownNode(MaasAPINotFound):
+class UnknownNode(MaaSAPINotFound):
"""Not a known node."""
@@ -114,7 +114,7 @@
"""
field = item.split('/')[0]
if field not in self.fields:
- raise MaasAPINotFound("Unknown metadata attribute: %s" % field)
+ raise MaaSAPINotFound("Unknown metadata attribute: %s" % field)
producers = {
'local-hostname': self.local_hostname,
=== modified file 'templates/test_module.html'
--- templates/test_module.html 2012-02-20 11:02:48 +0000
+++ templates/test_module.html 2012-02-24 17:43:20 +0000
@@ -14,7 +14,7 @@
<script type="text/javascript" src="test_sample.js"></script>
<script type="text/javascript">
<!--
- var MAAS_config = {
+ var MaaS_config = {
uris: {
statics: '/static/',
nodes_handler: '/api/nodes/'
=== modified file 'twisted/plugins/maasps.py'
--- twisted/plugins/maasps.py 2012-01-26 17:23:04 +0000
+++ twisted/plugins/maasps.py 2012-02-24 17:43:20 +0000
@@ -1,7 +1,7 @@
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Twisted Application Plugin for the Maas provisioning server."""
+"""Twisted Application Plugin for the MaaS provisioning server."""
from __future__ import (
print_function,
=== added file 'utilities/normalize-spelling'
--- utilities/normalize-spelling 1970-01-01 00:00:00 +0000
+++ utilities/normalize-spelling 2012-02-24 17:43:20 +0000
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# Copyright 2012 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+# Exit immediately if a command exits with a non-zero status.
+set -o errexit
+# Treat unset variables as an error when substituting.
+set -o nounset
+
+# Normalize the spelling of MaaS to either MaaS or maas, depending on
+# the capitalization of the first letter.
+bzr ls -VR --kind=file --null \
+ | xargs -r0 grep -Iil maas --null \
+ | xargs -r0 sed -i 's/M[Aa][Aa][Ss]/MaaS/g;s/m[Aa][Aa][Ss]/maas/g'