Permalink
Browse files

bug 702596: rename balrog's client web portion to something different…

…. r=nthomas
  • Loading branch information...
mozbhearsum committed Jun 13, 2012
1 parent 1dd3c47 commit e82cc7f08f066298a325e244ccec101418ea2b5e
Showing with 85 additions and 82 deletions.
  1. +1 −1 admin.py
  2. +1 −1 admin.wsgi
  3. 0 auslib/{client → admin}/__init__.py
  4. +42 −0 auslib/admin/base.py
  5. 0 auslib/{web → admin}/static/ausadmin.css
  6. 0 auslib/{web → admin}/static/ausadmin.js
  7. BIN auslib/{web → admin}/static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
  8. BIN auslib/{web → admin}/static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
  9. BIN auslib/{web → admin}/static/css/smoothness/images/ui-icons_454545_256x240.png
  10. BIN auslib/{web → admin}/static/css/smoothness/images/ui-icons_888888_256x240.png
  11. 0 auslib/{web → admin}/static/css/smoothness/jquery-ui-1.8.18.custom.css
  12. 0 auslib/{web → admin}/static/jquery-1.6.4.js
  13. 0 auslib/{web → admin}/static/jquery.dataTables.1.9.0.min.js
  14. 0 auslib/{web → admin}/static/js/jquery-ui-1.8.18.custom.min.js
  15. 0 auslib/{web → admin}/static/releases.js
  16. 0 auslib/{web → admin}/static/rules.js
  17. 0 auslib/{web → admin}/templates/base.html
  18. 0 auslib/{web → admin}/templates/fragments/new_permission.html
  19. 0 auslib/{web → admin}/templates/fragments/new_user.html
  20. 0 auslib/{web → admin}/templates/fragments/permission.html
  21. 0 auslib/{web → admin}/templates/fragments/release_row.html
  22. 0 auslib/{web → admin}/templates/fragments/releases.html
  23. 0 auslib/{web → admin}/templates/fragments/rule_form_row.html
  24. 0 auslib/{web → admin}/templates/fragments/rules.html
  25. 0 auslib/{web → admin}/templates/fragments/single_rule.html
  26. 0 auslib/{web → admin}/templates/fragments/user_permissions.html
  27. 0 auslib/{web → admin}/templates/fragments/users.html
  28. 0 auslib/{web → admin}/templates/permissions.html
  29. 0 auslib/{web → admin}/templates/releases.html
  30. 0 auslib/{web → admin}/templates/rules.html
  31. 0 auslib/{web → admin}/templates/user_permissions.html
  32. 0 auslib/{client → admin}/views/__init__.py
  33. +1 −1 auslib/{web → admin}/views/base.py
  34. +1 −1 auslib/{web → admin}/views/csrf.py
  35. 0 auslib/{web → admin}/views/forms.py
  36. +3 −3 auslib/{web → admin}/views/permissions.py
  37. +4 −4 auslib/{web → admin}/views/releases.py
  38. +3 −3 auslib/{web → admin}/views/rules.py
  39. +0 −25 auslib/client/base.py
  40. 0 auslib/test/{client → admin}/__init__.py
  41. 0 auslib/test/{web → admin}/views/__init__.py
  42. +1 −1 auslib/test/{web → admin}/views/base.py
  43. +1 −1 auslib/test/{web → admin}/views/test_base.py
  44. +2 −2 auslib/test/{web → admin}/views/test_csrf.py
  45. +2 −2 auslib/test/{web → admin}/views/test_permissions.py
  46. +3 −3 auslib/test/{web → admin}/views/test_releases.py
  47. +2 −2 auslib/test/{web → admin}/views/test_rules.py
  48. +2 −2 auslib/test/{client → web}/test_client.py
  49. +12 −24 auslib/web/base.py
  50. +1 −3 auslib/{client → web}/views/client.py
  51. 0 client.ini-dist → balrog.ini-dist
  52. +3 −3 client.wsgi → balrog.wsgi
View
@@ -28,7 +28,7 @@
log_level = logging.DEBUG
logging.basicConfig(level=log_level, format="%(asctime)s: %(message)s")
- from auslib.web.base import app, db
+ from auslib.admin.base import app, db
db.setDburi(options.db)
db.createTables()
View
@@ -7,7 +7,7 @@ mydir = path.dirname(path.abspath(__file__))
site.addsitedir(mydir)
site.addsitedir(path.join(mydir, 'vendor/lib/python'))
-from auslib.web.base import db, app as application
+from auslib.admin.base import db, app as application
from auslib.config import AdminConfig
cfg = AdminConfig('/etc/aus/admin.ini')
File renamed without changes.
View
@@ -0,0 +1,42 @@
+from flask import Flask, request
+
+from auslib import version
+from auslib.db import AUSDatabase
+
+import logging
+log = logging.getLogger(__name__)
+
+app = Flask(__name__)
+db = AUSDatabase()
+
+from auslib.admin.views.csrf import CSRFView
+from auslib.admin.views.permissions import UsersView, PermissionsView, \
+ SpecificPermissionView, PermissionsPageView, UserPermissionsPageView
+from auslib.admin.views.releases import SingleLocaleView, SingleBlobView, \
+ SingleReleaseView, ReleasesPageView
+from auslib.admin.views.rules import RulesPageView, RulesAPIView, SingleRuleView
+
+@app.errorhandler(500)
+def isa(error):
+ log.error("Caught ISE 500 error.")
+ log.debug("Balrog version is: %s", version)
+ log.debug("Request path is: %s", request.path)
+ log.debug("Request environment is: %s", request.environ)
+ log.debug("Request headers are: %s", request.headers)
+ return error
+
+app.add_url_rule('/csrf_token', view_func=CSRFView.as_view('csrf'))
+app.add_url_rule('/users', view_func=UsersView.as_view('users'))
+app.add_url_rule('/users/<username>/permissions', view_func=PermissionsView.as_view('permissions'))
+app.add_url_rule('/users/<username>/permissions/<path:permission>', view_func=SpecificPermissionView.as_view('specific_permission'))
+# Some permissions may start with a slash, and the <path> converter won't match them, so we need an extra rule to cope.
+app.add_url_rule('/users/<username>/permissions//<path:permission>', view_func=SpecificPermissionView.as_view('specific_permission'))
+app.add_url_rule('/permissions.html', view_func=PermissionsPageView.as_view('permissions.html'))
+app.add_url_rule('/user_permissions.html', view_func=UserPermissionsPageView.as_view('user_permissions.html'))
+app.add_url_rule('/releases/<release>/builds/<platform>/<locale>', view_func=SingleLocaleView.as_view('single_locale'))
+app.add_url_rule('/releases/<release>/data', view_func=SingleBlobView.as_view('release_data'))
+app.add_url_rule('/releases/<release>', view_func=SingleReleaseView.as_view('release'))
+app.add_url_rule('/releases.html', view_func=ReleasesPageView.as_view('releases.html'))
+app.add_url_rule('/rules.html', view_func=RulesPageView.as_view('rules.html'))
+app.add_url_rule('/rules', view_func=RulesAPIView.as_view('rules'))
+app.add_url_rule('/rules/<rule_id>', view_func=SingleRuleView.as_view('setrule'))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
from flask import request, Response
from flask.views import MethodView
-from auslib.web.base import db
+from auslib.admin.base import db
import logging
log = logging.getLogger(__name__)
@@ -1,7 +1,7 @@
from flask import Response
from flaskext.wtf import Form
-from auslib.web.views.base import AdminView
+from auslib.admin.views.base import AdminView
import logging
log = logging.getLogger(__name__)
File renamed without changes.
@@ -2,9 +2,9 @@
from flask import render_template, request, Response, jsonify, make_response
-from auslib.web.base import db
-from auslib.web.views.base import requirelogin, requirepermission, AdminView
-from auslib.web.views.forms import NewPermissionForm, ExistingPermissionForm
+from auslib.admin.base import db
+from auslib.admin.views.base import requirelogin, requirepermission, AdminView
+from auslib.admin.views.forms import NewPermissionForm, ExistingPermissionForm
import logging
log = logging.getLogger(__name__)
@@ -6,10 +6,10 @@
from auslib.blob import ReleaseBlobV1, CURRENT_SCHEMA_VERSION
from auslib.util.retry import retry
-from auslib.web.base import db
-from auslib.web.views.base import requirelogin, requirepermission, AdminView
-from auslib.web.views.csrf import get_csrf_headers
-from auslib.web.views.forms import ReleaseForm, NewReleaseForm
+from auslib.admin.base import db
+from auslib.admin.views.base import requirelogin, requirepermission, AdminView
+from auslib.admin.views.csrf import get_csrf_headers
+from auslib.admin.views.forms import ReleaseForm, NewReleaseForm
import logging
log = logging.getLogger(__name__)
@@ -3,9 +3,9 @@
from mozilla_buildtools.retry import retry
from sqlalchemy.exc import SQLAlchemyError
-from auslib.web.base import db
-from auslib.web.views.base import requirelogin, requirepermission, AdminView
-from auslib.web.views.forms import EditRuleForm, RuleForm
+from auslib.admin.base import db
+from auslib.admin.views.base import requirelogin, requirepermission, AdminView
+from auslib.admin.views.forms import EditRuleForm, RuleForm
import logging
log = logging.getLogger(__name__)
View
@@ -1,25 +0,0 @@
-from flask import Flask, make_response
-
-from auslib import version
-from auslib.AUS import AUS3
-
-app = Flask(__name__)
-AUS = AUS3()
-
-@app.errorhandler(404)
-def fourohfour(error):
- """We don't return 404s in AUS. Instead, we return empty XML files"""
- response = make_response('<?xml version="1.0"?>\n<updates>\n</updates>')
- response.mimetype = 'text/xml'
- return response
-
-@app.errorhandler(500)
-def isa(error):
- log.error("Caught ISE 500 error.")
- log.debug("Balrog version is: %s", version)
- log.debug("Request path is: %s", request.path)
- log.debug("Request environment is: %s", request.environ)
- log.debug("Request headers are: %s", request.headers)
- return error
-
-from auslib.client.views.client import *
File renamed without changes.
@@ -3,7 +3,7 @@
from flask import Response
-from auslib.web.base import app, db
+from auslib.admin.base import app, db
# When running tests, there's no web server to convert uncaught exceptions to
# 500 errors, so we need to do it here. Maybe we should just do it globally
@@ -1,4 +1,4 @@
-from auslib.test.web.views.base import ViewTest
+from auslib.test.admin.views.base import ViewTest
class TestRequirepermission(ViewTest):
def testAdmin(self):
@@ -3,8 +3,8 @@
import flaskext.wtf.form
-from auslib.web.base import app
-from auslib.test.web.views.base import ViewTest, HTMLTestMixin
+from auslib.admin.base import app
+from auslib.test.admin.views.base import ViewTest, HTMLTestMixin
class TestCSRFEndpoint(ViewTest, HTMLTestMixin):
def setUp(self):
@@ -1,7 +1,7 @@
import simplejson as json
-from auslib.web.base import db
-from auslib.test.web.views.base import ViewTest, JSONTestMixin, HTMLTestMixin
+from auslib.admin.base import db
+from auslib.test.admin.views.base import ViewTest, JSONTestMixin, HTMLTestMixin
class TestPermissionsAPI_JSON(ViewTest, JSONTestMixin):
def testUsers(self):
@@ -3,8 +3,8 @@
from sqlalchemy import select
-from auslib.web.base import db
-from auslib.test.web.views.base import ViewTest, JSONTestMixin, HTMLTestMixin
+from auslib.admin.base import db
+from auslib.test.admin.views.base import ViewTest, JSONTestMixin, HTMLTestMixin
class TestReleasesAPI_JSON(ViewTest, JSONTestMixin):
def testReleasePost(self):
@@ -214,7 +214,7 @@ def testLocalePutCantChangeProduct(self):
def testLocaleRevertsPartialUpdate(self):
data = json.dumps(dict(complete=dict(filesize=1)))
- with mock.patch('auslib.web.base.db.releases.addLocaleToRelease') as r:
+ with mock.patch('auslib.admin.base.db.releases.addLocaleToRelease') as r:
r.side_effect = Exception("Fail")
ret = self._put('/releases/a/builds/p/l', data=dict(data=data, product='a', version='c', data_version=1))
self.assertStatusCode(ret, 500)
@@ -1,5 +1,5 @@
-from auslib.web.base import db
-from auslib.test.web.views.base import ViewTest, HTMLTestMixin
+from auslib.admin.base import db
+from auslib.test.admin.views.base import ViewTest, HTMLTestMixin
class TestRulesAPI_HTML(ViewTest, HTMLTestMixin):
def testNewRulePost(self):
@@ -1,8 +1,8 @@
import unittest
from xml.dom import minidom
-from auslib.client.base import app, AUS
-from auslib.client.views.client import ClientRequestView
+from auslib.web.base import app, AUS
+from auslib.web.views.client import ClientRequestView
class ClientTest(unittest.TestCase):
def setUp(self):
View
@@ -1,17 +1,19 @@
-from flask import Flask, request
+from flask import Flask, make_response
from auslib import version
-from auslib.db import AUSDatabase
+from auslib.AUS import AUS3
app = Flask(__name__)
-db = AUSDatabase()
+AUS = AUS3()
-from auslib.web.views.csrf import CSRFView
-from auslib.web.views.permissions import UsersView, PermissionsView, \
- SpecificPermissionView, PermissionsPageView, UserPermissionsPageView
-from auslib.web.views.releases import SingleLocaleView, SingleBlobView, \
- SingleReleaseView, ReleasesPageView
-from auslib.web.views.rules import RulesPageView, RulesAPIView, SingleRuleView
+from auslib.web.views.client import ClientRequestView
+
+@app.errorhandler(404)
+def fourohfour(error):
+ """We don't return 404s in AUS. Instead, we return empty XML files"""
+ response = make_response('<?xml version="1.0"?>\n<updates>\n</updates>')
+ response.mimetype = 'text/xml'
+ return response
@app.errorhandler(500)
def isa(error):
@@ -22,18 +24,4 @@ def isa(error):
log.debug("Request headers are: %s", request.headers)
return error
-app.add_url_rule('/csrf_token', view_func=CSRFView.as_view('csrf'))
-app.add_url_rule('/users', view_func=UsersView.as_view('users'))
-app.add_url_rule('/users/<username>/permissions', view_func=PermissionsView.as_view('permissions'))
-app.add_url_rule('/users/<username>/permissions/<path:permission>', view_func=SpecificPermissionView.as_view('specific_permission'))
-# Some permissions may start with a slash, and the <path> converter won't match them, so we need an extra rule to cope.
-app.add_url_rule('/users/<username>/permissions//<path:permission>', view_func=SpecificPermissionView.as_view('specific_permission'))
-app.add_url_rule('/permissions.html', view_func=PermissionsPageView.as_view('permissions.html'))
-app.add_url_rule('/user_permissions.html', view_func=UserPermissionsPageView.as_view('user_permissions.html'))
-app.add_url_rule('/releases/<release>/builds/<platform>/<locale>', view_func=SingleLocaleView.as_view('single_locale'))
-app.add_url_rule('/releases/<release>/data', view_func=SingleBlobView.as_view('release_data'))
-app.add_url_rule('/releases/<release>', view_func=SingleReleaseView.as_view('release'))
-app.add_url_rule('/releases.html', view_func=ReleasesPageView.as_view('releases.html'))
-app.add_url_rule('/rules.html', view_func=RulesPageView.as_view('rules.html'))
-app.add_url_rule('/rules', view_func=RulesAPIView.as_view('rules'))
-app.add_url_rule('/rules/<rule_id>', view_func=SingleRuleView.as_view('setrule'))
+app.add_url_rule('/update/<int:queryVersion>/<product>/<version>/<buildID>/<buildTarget>/<locale>/<channel>/<osVersion>/<distribution>/<distVersion>/update.xml', view_func=ClientRequestView.as_view('clientrequest'))
@@ -1,7 +1,7 @@
from flask import make_response, request
from flask.views import MethodView
-from auslib.client.base import app, AUS
+from auslib.web.base import app, AUS
import logging
log = logging.getLogger(__name__)
@@ -61,5 +61,3 @@ def get(self, queryVersion, **url):
response = make_response(xml)
response.mimetype = 'text/xml'
return response
-
-app.add_url_rule('/update/<int:queryVersion>/<product>/<version>/<buildID>/<buildTarget>/<locale>/<channel>/<osVersion>/<distribution>/<distVersion>/update.xml', view_func=ClientRequestView.as_view('clientrequest'))
File renamed without changes.
@@ -7,11 +7,11 @@ mydir = path.dirname(path.abspath(__file__))
site.addsitedir(mydir)
site.addsitedir(path.join(mydir, 'vendor/lib/python'))
-from auslib.client.base import app as application
-from auslib.client.base import AUS
+from auslib.web.base import app as application
+from auslib.web.base import AUS
from auslib.config import ClientConfig
-cfg = ClientConfig('/etc/aus/client.ini')
+cfg = ClientConfig('/etc/aus/balrog.ini')
errors = cfg.validate()
if errors:
print >>sys.stderr, "Invalid configuration file:"

0 comments on commit e82cc7f

Please sign in to comment.